1 #ifndef KISSFFT_I32_CLASS_HH
2 #define KISSFFT_I32_CLASS_HH
12 template <
typename DType>
41 const double phinc = (
_inverse ? 2 : -2) * acos(-1.0) /
_nfft;
44 _twiddles[i] = scale_factor * exp(complex<double>(0, i * phinc));
95 cpx_type *
const Fout_end = FDst + p * m;
102 FSrc += fstride * in_stride;
103 }
while (++FDst != Fout_end);
113 transform(FSrc, FDst, stage + 1, fstride * p, in_stride);
114 FSrc += fstride * in_stride;
115 }
while ((FDst += m) != Fout_end);
148 Fout[m + k] = Fout[k] - t;
168 scratch[3] = scratch[1] + scratch[2];
169 scratch[0] = scratch[1] - scratch[2];
173 Fout[m] = Fout[0] - (scratch[3] / 2);
174 scratch[0] *= epi3.imag();
177 Fout[0] += scratch[3];
179 Fout[m2] =
cpx_type(Fout[m].real() + scratch[0].imag(), Fout[m].imag() - scratch[0].real());
181 Fout[m] +=
cpx_type(-scratch[0].imag(), scratch[0].real());
196 scratch[5] = Fout[k] - scratch[1];
198 Fout[k] += scratch[1];
199 scratch[3] = scratch[0] + scratch[2];
200 scratch[4] = scratch[0] - scratch[2];
201 scratch[4] =
cpx_type(scratch[4].imag() * negative_if_inverse,
202 -scratch[4].real() * negative_if_inverse);
204 Fout[k + 2 * m] = Fout[k] - scratch[3];
205 Fout[k] += scratch[3];
206 Fout[k + m] = scratch[5] + scratch[4];
207 Fout[k + 3 * m] = scratch[5] - scratch[4];
213 cpx_type *Fout0, *Fout1, *Fout2, *Fout3, *Fout4;
220 Fout2 = Fout0 + 2 * m;
221 Fout3 = Fout0 + 3 * m;
222 Fout4 = Fout0 + 4 * m;
233 scratch[7] = scratch[1] + scratch[4];
234 scratch[10] = scratch[1] - scratch[4];
235 scratch[8] = scratch[2] + scratch[3];
236 scratch[9] = scratch[2] - scratch[3];
238 *Fout0 += scratch[7];
239 *Fout0 += scratch[8];
241 scratch[5] = scratch[0] + (
cpx_type(
242 scratch[7].real() * ya.real() + scratch[8].real() * yb.real(),
243 scratch[7].imag() * ya.real() + scratch[8].imag() * yb.real() ) /
_scale_factor);
246 scratch[10].imag() * ya.imag() + scratch[9].imag() * yb.imag(),
247 -scratch[10].real() * ya.imag() - scratch[9].real() * yb.imag() ) /
_scale_factor;
249 *Fout1 = scratch[5] - scratch[6];
250 *Fout4 = scratch[5] + scratch[6];
252 scratch[11] = scratch[0] + (
cpx_type(
253 scratch[7].real() * yb.real() + scratch[8].real() * ya.real(),
254 scratch[7].imag() * yb.real() + scratch[8].imag() * ya.real() ) /
_scale_factor);
257 -scratch[10].imag() * yb.imag() + scratch[9].imag() * ya.imag(),
258 scratch[10].real() * yb.imag() - scratch[9].real() * ya.imag() ) /
_scale_factor;
260 *Fout2 = scratch[11] + scratch[12];
261 *Fout3 = scratch[11] - scratch[12];
282 scratchbuf[q1] = Fout[k];
290 Fout[k] = scratchbuf[0];
293 twidx += fstride * k;
296 Fout[k] += (scratchbuf[q] * twiddles[twidx]) /
_scale_factor;