moved scaling to Eigen::FFT

This commit is contained in:
Mark Borgerding
2009-10-30 19:50:11 -04:00
parent 0fa68b9e50
commit a26b729cc9
3 changed files with 61 additions and 33 deletions

View File

@@ -187,12 +187,6 @@
void inv(Complex * dst,const Complex *src,int nfft)
{
get_plan(nfft,true,dst,src).inv(ei_fftw_cast(dst), ei_fftw_cast(src),nfft );
//TODO move scaling to Eigen::FFT
// scaling
Scalar s = Scalar(1.)/nfft;
for (int k=0;k<nfft;++k)
dst[k] *= s;
}
// half-complex to scalar
@@ -200,11 +194,6 @@
void inv( Scalar * dst,const Complex * src,int nfft)
{
get_plan(nfft,true,dst,src).inv(ei_fftw_cast(dst), ei_fftw_cast(src),nfft );
//TODO move scaling to Eigen::FFT
Scalar s = Scalar(1.)/nfft;
for (int k=0;k<nfft;++k)
dst[k] *= s;
}
protected:

View File

@@ -334,7 +334,6 @@
void inv(Complex * dst,const Complex *src,int nfft)
{
get_plan(nfft,true).work(0, dst, src, 1,1);
scale(dst, nfft, Scalar(1)/nfft );
}
// half-complex to scalar
@@ -362,7 +361,6 @@
m_tmpBuf[k] = fek + fok;
m_tmpBuf[ncfft-k] = conj(fek - fok);
}
scale(&m_tmpBuf[0], ncfft, Scalar(1)/nfft );
get_plan(ncfft,true).work(0, reinterpret_cast<Complex*>(dst), &m_tmpBuf[0], 1,1);
}
}
@@ -403,12 +401,4 @@
}
return &twidref[0];
}
// TODO move scaling up into Eigen::FFT
inline
void scale(Complex *dst,int n,Scalar s)
{
for (int k=0;k<n;++k)
dst[k] *= s;
}
};