Skip to content
Snippets Groups Projects
Commit 47195bcf authored by Kristoffer Tondel's avatar Kristoffer Tondel
Browse files

fixade RECFFT

parent d15f9594
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ std::vector<std::complex<double>> fftrec(std::vector<std::complex<double>> f,int
{
for(int i=0; i <= NN-1; i++)
{
fftv[i] = f[0]+std::pow(w,-NN/2+i)*f[2];
fftv[i] = f[0]+std::pow(w,i)*f[1];
}
}
else
......@@ -41,7 +41,7 @@ std::vector<std::complex<double>> fftrec(std::vector<std::complex<double>> f,int
std::vector<std::complex<double>> b2 = fftrec(b1,NN,fftv,flag);
for(int k = 0; k <= NN-1; k++)
{
fftv[k] = a2[k] + b2[k]*std::pow(w,k-NN/2.0);
fftv[k] = a2[k] + b2[k]*std::pow(w,k);
}
}
return fftv;
......@@ -71,6 +71,11 @@ int main()
std::vector<std::complex<double>> transf = fftrec(inputVector,n,fftv1,-1);
std::vector<std::complex<double>> invTransf = fftrec(transf,n,fftv2,1);
// -----------------------------------------------------------------------------
for(int i=0;i<n;i++)
{
invTransf[i]=invTransf[i]*1.0/16.0;
}
call.printToFile(invTransf,outFile,n);
std::cout<<"RECFFT done"<<'\n';
......
No preview for this file type
-0.6806533169,-2.1294354386
-0.1269205667,-0.7429836014
-0.6806533169,-0.2032087431
-0.1269205667,-0.5181073468
-0.6806533169,0.3420809383
-0.1269205667,-0.5126149384
-0.6806533169,1.0322190424
-0.1269205667,-0.7996013102
-0.6806533169,3.9315113747
-6.8586884451,-3.2520124213
6.5937260977,-4.5170493085
-1.2558806312,8.7942247812
-6.7350732794,-5.8063964610
7.5444736306,-1.0391267346
-2.9159773025,7.3502785957
-5.3828133564,-1.9297784284
0.0000000000,-0.0000000000
0.8414709848,-0.0000000000
0.9092974268,0.0000000000
0.1411200081,0.0000000000
-0.7568024953,0.0000000000
-0.9589242747,0.0000000000
-0.2794154982,-0.0000000000
0.6569865987,-0.0000000000
0.9893582466,-0.0000000000
0.4121184852,-0.0000000000
-0.5440211109,-0.0000000000
-0.9999902066,0.0000000000
-0.5365729180,0.0000000000
0.4201670368,0.0000000000
0.9906073557,0.0000000000
0.6502878402,-0.0000000000
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment