17 template <
typename _Scalar>
34 double phinc = 0.25 * double(
EIGEN_PI) / nfft;
80 default:
p += 2;
break;
93 template <
typename _Src>
95 void work(
int stage,
Complex * xout,
const _Src * xin,
size_t fstride,
size_t in_stride)
108 work(stage+1, xout , xin, fstride*
p,in_stride);
109 xin += fstride*in_stride;
110 }
while( (xout +=
m) != Fout_end );
114 xin += fstride*in_stride;
115 }
while(++xout != Fout_end );
121 case 2:
bfly2(xout,fstride,
m);
break;
122 case 3:
bfly3(xout,fstride,
m);
break;
123 case 4:
bfly4(xout,fstride,
m);
break;
124 case 5:
bfly5(xout,fstride,
m);
break;
132 for (
int k=0;k<
m;++k) {
134 Fout[
m+k] = Fout[k] -
t;
143 int negative_if_inverse =
m_inverse * -2 +1;
144 for (
size_t k=0;k<
m;++k) {
146 scratch[1] = Fout[k+2*
m] *
m_twiddles[k*fstride*2];
147 scratch[2] = Fout[k+3*
m] *
m_twiddles[k*fstride*3];
148 scratch[5] = Fout[k] - scratch[1];
150 Fout[k] += scratch[1];
151 scratch[3] = scratch[0] + scratch[2];
152 scratch[4] = scratch[0] - scratch[2];
153 scratch[4] =
Complex( scratch[4].
imag()*negative_if_inverse , -scratch[4].
real()* negative_if_inverse );
155 Fout[k+2*
m] = Fout[k] - scratch[3];
156 Fout[k] += scratch[3];
157 Fout[k+
m] = scratch[5] + scratch[4];
158 Fout[k+3*
m] = scratch[5] - scratch[4];
166 const size_t m2 = 2*
m;
175 scratch[1]=Fout[
m] * *tw1;
176 scratch[2]=Fout[
m2] * *tw2;
178 scratch[3]=scratch[1]+scratch[2];
179 scratch[0]=scratch[1]-scratch[2];
183 scratch[0] *= epi3.imag();
194 Complex *Fout0,*Fout1,*Fout2,*Fout3,*Fout4;
200 ya = twiddles[fstride*
m];
201 yb = twiddles[fstride*2*
m];
210 for ( u=0; u<
m; ++u ) {
213 scratch[1] = *Fout1 * tw[u*fstride];
214 scratch[2] = *Fout2 * tw[2*u*fstride];
215 scratch[3] = *Fout3 * tw[3*u*fstride];
216 scratch[4] = *Fout4 * tw[4*u*fstride];
218 scratch[7] = scratch[1] + scratch[4];
219 scratch[10] = scratch[1] - scratch[4];
220 scratch[8] = scratch[2] + scratch[3];
221 scratch[9] = scratch[2] - scratch[3];
223 *Fout0 += scratch[7];
224 *Fout0 += scratch[8];
226 scratch[5] = scratch[0] +
Complex(
227 (scratch[7].
real()*ya.real() ) + (scratch[8].real() *yb.real() ),
228 (scratch[7].imag()*ya.real()) + (scratch[8].imag()*yb.real())
232 (scratch[10].
imag()*ya.imag()) + (scratch[9].imag()*yb.imag()),
233 -(scratch[10].real()*ya.imag()) - (scratch[9].real()*yb.imag())
236 *Fout1 = scratch[5] - scratch[6];
237 *Fout4 = scratch[5] + scratch[6];
239 scratch[11] = scratch[0] +
241 (scratch[7].
real()*yb.real()) + (scratch[8].real()*ya.real()),
242 (scratch[7].imag()*yb.real()) + (scratch[8].imag()*ya.real())
246 -(scratch[10].
imag()*yb.imag()) + (scratch[9].imag()*ya.imag()),
247 (scratch[10].real()*yb.imag()) - (scratch[9].real()*ya.imag())
250 *Fout2=scratch[11]+scratch[12];
251 *Fout3=scratch[11]-scratch[12];
253 ++Fout0;++Fout1;++Fout2;++Fout3;++Fout4;
261 const size_t fstride,
269 int Norig =
static_cast<int>(
m_twiddles.size());
272 for ( u=0; u<
m; ++u ) {
274 for ( q1=0 ; q1<
p ; ++q1 ) {
275 scratchbuf[q1] = Fout[ k ];
280 for ( q1=0 ; q1<
p ; ++q1 ) {
282 Fout[ k ] = scratchbuf[0];
284 twidx +=
static_cast<int>(fstride) * k;
285 if (twidx>=Norig) twidx-=Norig;
286 t=scratchbuf[
q] * twiddles[twidx];
295 template <
typename _Scalar>
345 int ncfft2 = nfft>>2;
349 fwd( dst,
reinterpret_cast<const Complex*
> (src), ncfft);
353 for ( k=1;k <= ncfft2 ; ++k ) {
359 dst[k] = (f1k + tw) *
Scalar(.5);
363 dst[ncfft] = nyquist;
381 std::copy(src,src+(nfft>>1)+1,
m_tmpBuf1.begin() );
382 for (
int k=1;k<(nfft>>1)+1;++k)
385 for (
int k=0;k<nfft;++k)
390 int ncfft2 = nfft>>2;
394 for (
int k = 1; k <= ncfft / 2; ++k) {
417 int PlanKey(
int nfft,
bool isinverse)
const {
return (nfft<<1) |
int(isinverse); }
436 if ( (
int)twidref.size() != ncfft2 ) {
437 twidref.resize(ncfft2);
438 int ncfft= ncfft2<<1;
440 for (
int k=1;k<=ncfft2;++k)