Home | History | Annotate | Download | only in FFT

Lines Matching refs:Complex

21   typedef std::complex<Scalar> Complex;
22 std::vector<Complex> m_twiddles;
25 std::vector<Complex> m_scratchBuf;
35 m_twiddles[i] = exp( Complex(0,i*phinc) );
63 void work( int stage,Complex * xout, const _Src * xin, size_t fstride,size_t in_stride)
67 Complex * Fout_beg = xout;
68 Complex * Fout_end = xout + p*m;
98 void bfly2( Complex * Fout, const size_t fstride, int m)
101 Complex t = Fout[m+k] * m_twiddles[k*fstride];
108 void bfly4( Complex * Fout, const size_t fstride, const size_t m)
110 Complex scratch[6];
121 scratch[4] = Complex( scratch[4].imag()*negative_if_inverse , -scratch[4].real()* negative_if_inverse );
131 void bfly3( Complex * Fout, const size_t fstride, const size_t m)
135 Complex *tw1,*tw2;
136 Complex scratch[5];
137 Complex epi3;
150 Fout[m] = Complex( Fout->real() - Scalar(.5)*scratch[3].real() , Fout->imag() - Scalar(.5)*scratch[3].imag() );
153 Fout[m2] = Complex( Fout[m].real() + scratch[0].imag() , Fout[m].imag() - scratch[0].real() );
154 Fout[m] += Complex( -scratch[0].imag(),scratch[0].real() );
160 void bfly5( Complex * Fout, const size_t fstride, const size_t m)
162 Complex *Fout0,*Fout1,*Fout2,*Fout3,*Fout4;
164 Complex scratch[13];
165 Complex * twiddles = &m_twiddles[0];
166 Complex *tw;
167 Complex ya,yb;
194 scratch[5] = scratch[0] + Complex(
199 scratch[6] = Complex(
208 Complex(
213 scratch[12] = Complex(
228 Complex * Fout,
235 Complex * twiddles = &m_twiddles[0];
236 Complex t;
238 Complex * scratchbuf = &m_scratchBuf[0];
267 typedef std::complex<Scalar> Complex;
276 void fwd( Complex * dst,const Complex *src,int nfft)
282 void fwd2( Complex * dst,const Complex *src,int n0,int n1)
291 void inv2( Complex * dst,const Complex *src,int n0,int n1)
299 // real-to-complex forward FFT
304 void fwd( Complex * dst,const Scalar * src,int nfft)
314 Complex * rtw = real_twiddles(ncfft2);
317 fwd( dst, reinterpret_cast<const Complex*> (src), ncfft);
318 Complex dc = dst[0].real() + dst[0].imag();
319 Complex nyquist = dst[0].real() - dst[0].imag();
322 Complex fpk = dst[k];
323 Complex fpnk = conj(dst[ncfft-k]);
324 Complex f1k = fpk + fpnk;
325 Complex f2k = fpk - fpnk;
326 Complex tw= f2k * rtw[k-1];
335 // inverse complex-to-complex
337 void inv(Complex * dst,const Complex *src,int nfft)
342 // half-complex to scalar
344 void inv( Scalar * dst,const Complex * src,int nfft)
359 Complex * rtw = real_twiddles(ncfft2);
361 m_tmpBuf1[0] = Complex( src[0].real() + src[ncfft].real(), src[0].real() - src[ncfft].real() );
363 Complex fk = src[k];
364 Complex fnkc = conj(src[ncfft-k]);
365 Complex fek = fk + fnkc;
366 Complex tmp = fk - fnkc;
367 Complex fok = tmp * conj(rtw[k-1]);
371 get_plan(ncfft,true).work(0, reinterpret_cast<Complex*>(dst), &m_tmpBuf1[0], 1,1);
380 std::map<int, std::vector<Complex> > m_realTwiddles;
381 std::vector<Complex> m_tmpBuf1;
382 std::vector<Complex> m_tmpBuf2;
400 Complex * real_twiddles(int ncfft2)
402 std::vector<Complex> & twidref = m_realTwiddles[ncfft2];// creates new if not there
408 twidref[k-1] = exp( Complex(0,-pi * (Scalar(k) / ncfft + Scalar(.5)) ) );