Fast Fourier Transform
Copyright (C) 2005 IENT-RWTH Aachen
Notation convention
The C Interface for FFT functions uses the following notation convention:
FFT: c|z|s|d [h] [a|n] fft [1|2]
IFFT: c|z|s|d ifft [1|2]
c|z|s|d | single precision complex | double precision complex | single precision real | double precision real |
[h] | halfed output (only possible for real input) |
[a|n] | abs | norm (presently only possible for vectorial input) |
[1|2] | matrices rows | matrices |
Examples
{ int n=8; DenseVector<float>::self X(n,1); DenseVector<complex<float> >::self Y(n); //sfft(X.size(),&X[0],(float *)&Y[0]); // slower than shfft shfft(X.size(),Y.size(),&X[0],(float *)&Y[0]); sifft(X.size(),(float *)&Y[0],&X[0]); cout << X << endl; } { int n=8; DenseVector<complex<double> >::self X(n,1), Y(n); zfft (X.size(),(double *)&X[0],(double *)&Y[0]); zifft(X.size(),(double *)&Y[0],(double *)&X[0]); cout << X << endl; } { int m=8,n=8; DenseMatrix<float>::self X(m,n,1); DenseMatrix<complex<double> >::self Y(m,n); //sfft2 (X.nrows(),X.ncols(),&X(0,0),(float *)&Y(0,0)); // slower than shfft2 shfft2(X.nrows(),X.ncols(),Y.nrows(),&X(0,0),(float *)&Y(0,0)); sifft2(X.nrows(),X.ncols(),Y.nrows(),(float *)&Y(0,0),&X(0,0)); cout << X << endl; } { int m=8,n=8; DenseMatrix<complex<double> >::self X(m,n,1), Y(m,n); zfft2 (X.nrows(),X.ncols(),(double *)&X(0,0),(double *)&Y(0,0)); zifft2(X.nrows(),X.ncols(),(double *)&Y(0,0),(double *)&X(0,0)); cout << X << endl; }
See Also