Home | History | Annotate | Download | only in FFT

Lines Matching defs:Complex

21   typedef std::complex<Scalar> Complex;
22 std::vector<Complex> m_twiddles;
25 std::vector<Complex> m_scratchBuf;
36 m_twiddles[i] = exp( Complex(0,i*phinc) );
64 void work( int stage,Complex * xout, const _Src * xin, size_t fstride,size_t in_stride)
68 Complex * Fout_beg = xout;
69 Complex * Fout_end = xout + p*m;
99 void bfly2( Complex * Fout, const size_t fstride, int m)
102 Complex t = Fout[m+k] * m_twiddles[k*fstride];
109 void bfly4( Complex * Fout, const size_t fstride, const size_t m)
111 Complex scratch[6];
122 scratch[4] = Complex( scratch[4].imag()*negative_if_inverse , -scratch[4].real()* negative_if_inverse );
132 void bfly3( Complex * Fout, const size_t fstride, const size_t m)
136 Complex *tw1,*tw2;
137 Complex scratch[5];
138 Complex epi3;
151 Fout[m] = Complex( Fout->real() - Scalar(.5)*scratch[3].real() , Fout->imag() - Scalar(.5)*scratch[3].imag() );
154 Fout[m2] = Complex( Fout[m].real() + scratch[0].imag() , Fout[m].imag() - scratch[0].real() );
155 Fout[m] += Complex( -scratch[0].imag(),scratch[0].real() );
161 void bfly5( Complex * Fout, const size_t fstride, const size_t m)
163 Complex *Fout0,*Fout1,*Fout2,*Fout3,*Fout4;
165 Complex scratch[13];
166 Complex * twiddles = &m_twiddles[0];
167 Complex *tw;
168 Complex ya,yb;
195 scratch[5] = scratch[0] + Complex(
200 scratch[6] = Complex(
209 Complex(
214 scratch[12] = Complex(
229 Complex * Fout,
236 Complex * twiddles = &m_twiddles[0];
237 Complex t;
239 Complex * scratchbuf = &m_scratchBuf[0];
268 typedef std::complex<Scalar> Complex;
277 void fwd( Complex * dst,const Complex *src,int nfft)
283 void fwd2( Complex * dst,const Complex *src,int n0,int n1)
292 void inv2( Complex * dst,const Complex *src,int n0,int n1)
300 // real-to-complex forward FFT
305 void fwd( Complex * dst,const Scalar * src,int nfft)
315 Complex * rtw = real_twiddles(ncfft2);
318 fwd( dst, reinterpret_cast<const Complex*> (src), ncfft);
319 Complex dc = dst[0].real() + dst[0].imag();
320 Complex nyquist = dst[0].real() - dst[0].imag();
323 Complex fpk = dst[k];
324 Complex fpnk = conj(dst[ncfft-k]);
325 Complex f1k = fpk + fpnk;
326 Complex f2k = fpk - fpnk;
327 Complex tw= f2k * rtw[k-1];
336 // inverse complex-to-complex
338 void inv(Complex * dst,const Complex *src,int nfft)
343 // half-complex to scalar
345 void inv( Scalar * dst,const Complex * src,int nfft)
360 Complex * rtw = real_twiddles(ncfft2);
362 m_tmpBuf1[0] = Complex( src[0].real() + src[ncfft].real(), src[0].real() - src[ncfft].real() );
364 Complex fk = src[k];
365 Complex fnkc = conj(src[ncfft-k]);
366 Complex fek = fk + fnkc;
367 Complex tmp = fk - fnkc;
368 Complex fok = tmp * conj(rtw[k-1]);
372 get_plan(ncfft,true).work(0, reinterpret_cast<Complex*>(dst), &m_tmpBuf1[0], 1,1);
381 std::map<int, std::vector<Complex> > m_realTwiddles;
382 std::vector<Complex> m_tmpBuf1;
383 std::vector<Complex> m_tmpBuf2;
401 Complex * real_twiddles(int ncfft2)
404 std::vector<Complex> & twidref = m_realTwiddles[ncfft2];// creates new if not there
410 twidref[k-1] = exp( Complex(0,-pi * (Scalar(k) / ncfft + Scalar(.5)) ) );