feat : Implemented Fast Fourier Transform

This commit is contained in:
ameyachawlaggsipu 2021-10-07 20:18:08 +05:30 committed by GitHub
parent 3624574e80
commit 939c596630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}