mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
feat : Implemented Fast Fourier Transform
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user