mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-11-25 05:04:36 +08:00
feat : Implemented Fast Fourier Transform
This commit is contained in:
committed by
GitHub
parent
3624574e80
commit
939c596630
@@ -55,8 +55,8 @@ complex<double>* FastFourierTransform(complex<double>*p,int n)
|
||||
|
||||
for(int i=0;i<n/2;i++)
|
||||
{
|
||||
y[i]=ye[i]+pow(om,i)*yo[i]; ///Updating the first n/2 elemnts
|
||||
y[i+n/2]=ye[i]-pow(om,i)*yo[i];///Updating the last n/2 elemnts
|
||||
y[i]=ye[i]+pow(om,i)*yo[i]; ///Updating the first n/2 elements
|
||||
y[i+n/2]=ye[i]-pow(om,i)*yo[i];///Updating the last n/2 elements
|
||||
}
|
||||
|
||||
return y;///Return the list
|
||||
@@ -119,4 +119,4 @@ int main(int argc, char const *argv[])
|
||||
test();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user