MFb_Cols_FFT MDb_Cols_FFT MEb_Cols_FFT
MF_Cols_FFTtoC MD_Cols_FFTtoC ME_Cols_FFTtoC
MFb_Cols_FFTtoC MDb_Cols_FFTtoC MEb_Cols_FFTtoC
FunctionFast Fourier Transform along the columns
Syntax C/C++#include <MFstd.h>
void MF_Cols_FFT( fMatrix Y, fMatrix X, ui ht, ui len, int dir );
void MCF_Cols_FFT( cfMatrix Y, cfMatrix X, ui ht, ui len, int dir );
void MF_Cols_FFTtoC( cfMatrix Y, fMatrix X, ui ht, ui len );
void MFb_Cols_FFT( fMatrix Y, fMatrix X, ui ht, ui len, int dir, fVector Buf );
void MCFb_Cols_FFT( cfMatrix Y, cfMatrix X, ui ht, ui len, int dir, cfVector Buf );
void MFb_Cols_FFTtoC( cfMatrix Y, fMatrix X, ui ht, ui len, cfVector Buf );
C++ MatObj#include <OptiVec.h>
void matrix<T>::Cols_FFT( const matrix<T>& MX, int dir );
void matrix<complex<T> >::FFT( const matrix<complex<T> >& MX, int dir );
void matrix<complex<T> >::FFTtoC( const matrix<T>& MX );
void matrix<T>::b_Cols_FFT( const matrix<T>& MX, int dir, vector<T>& Buf );
void matrix<complex<T> >::b_Cols_FFT( const matrix<complex<T> > MX, int dir, vector<complex<T> >&Buf );
void matrix<complex<T> >::b_Cols_FFTtoC( const matrix<T> MX, vector<complex<T>>&Buf );
Pascal/Delphiuses MFstd;
procedure MF_Cols_FFT( MY, MX:fMatrix; ht, len:UIntSize; dir:Integer );
procedure MCF_Cols_FFT( MY, MX:cfMatrix; ht, len:UIntSize; dir:Integer );
procedure MF_Cols_FFTtoC( MY:cfMatrix; MX:fMatrix; ht, len:UIntSize );
procedure MFb_Cols_FFT( MY, MX:fMatrix; ht, len:UIntSize; dir:Integer; Buf:fVector );
procedure MCFb_Cols_FFT( MY, MX:cfMatrix; ht, len:UIntSize; dir:Integer; Buf:cfVector );
procedure MFb_Cols_FFTtoC( MY:cfMatrix; MX:fMatrix; ht, len:UIntSize; Buf:cfVector );
CUDA function C/C++#include <cudaMFstd.h>
#include <cudaMCFstd.h>
int cudaMF_Cols_FFT( fMatrix d_Y, fMatrix d_X, ui ht, ui len, int dir );
int cuda MCF_Cols_FFT( cfMatrix d_Y, cfMatrix d_X, ui ht, ui len, int dir );
int cudaMF_Cols_FFTtoC( cfMatrix d_Y, fMatrix d_X, ui ht, ui len );
void MFcu_Cols_FFT( fMatrix h_Y, fMatrix h_X, ui ht, ui len, int dir );
void MCFcu_Cols_FFT( cfMatrix h_Y, cfMatrix h_X, ui ht, ui len, int dir );
void MFcu_Cols_FFTtoC( cfMatrix h_Y, fMatrix h_X, ui ht, ui len );
CUDA function Pascal/Delphiuses MFstd, MCFstd;
function cudaMF_Cols_FFT( d_MY, d_MX:fMatrix; ht, len:UIntSize; dir:Integer ): IntBool;
function cudaMCF_Cols_FFT( d_MY, d_MX:cfMatrix; ht, len:UIntSize; dir:Integer ): IntBool;
function cudaMF_Cols_FFTtoC( d_MY:cfMatrix; d_MX:fMatrix; ht, len:UIntSize ): IntBool;
procedure MFcu_Cols_FFT( h_MY, h_MX:fMatrix; ht, len:UIntSize; dir:Integer );
procedure MCFcu_Cols_FFT( h_MY, h_MX:cfMatrix; ht, len:UIntSize; dir:Integer );
procedure MFcu_Cols_FFTtoC( h_MY:cfMatrix; h_MX:fMatrix; ht, len:UIntSize );
DescriptionThe one-dimensional Fourier transform of all columns of MX is calculated and stored in the corresponding columns of MY. The forward transform is obtained by setting dir = 1, the inverse (or backward) transform by setting dir = -1. By convention, the inverse transform involves scaling the result by the factor 1.0/ht (so as to ensure that the result of one forward and one backward transform yields – within round-off error – the original matrix). Since it is sometimes desirable to skip this implicit scaling, MF_Cols_FFT offers the possibility to do so: specify dir = -2 in this case.
A Fast Fourier Transform algorithm is used that requires ht to be a power of 2.  len may be set arbitrarily, but the function will be most efficient if len is a multiple of 4.
Complex version: Both MX and the output MY are complex matrices.
Real-to-complex version: The input matrix MX is real. The output matrix MY is complex. As this function can only perform a forward transform, no argument "dir" is needed.
Purely real version: For the forward transform, MX is a real matrix. The output MY is also defined as fMatrix, although it consists of complex numbers. The reason is that the symmetry properties of FFT allow to store the result in a packed format, fitting into the same memory space as the input matrix. The order of each column of MY is indicated in the following table. U means the uncompressed result, N is ht.
Y0, iU0, i.Re
Y1, iUN/2, i.Re
Y2, iU1, i.Re
Y3, iU1, i.Im
  .....    .....  
YN-2, iUN/2-1, i.Re
YN-1, iUN/2-1, i.Im
This storage scheme implies that, for C/C++ (where matrices are stored in row-major order), the real and imaginary parts of any element are not adjacent in memory .
For inverse real-matrix Cols_FFT, the input matrix has to be of this packed-complex format, and you get a real matrix. If you prefer to get the result of forward FFT in true complex format, use MF_Cols_FFTtoC.

MFb_Cols_FFT, MFb_Cols_FFTtoC and MCFb_Cols_FFT take a buffer vector Buf as an additional argument. They are slightly more efficient than the un-buffered versions. Buf must have (at least) the same size as MX and MY (i.e., Buf.size >= ht*len).

Error handlingIf ht is not a power of 2, the program is aborted with the error message "Size must be an integer power of 2".
See alsoMF_Rows_FFT,   MF_FFT,   chapter 12,   chapter 4.8 of

MatrixLib Table of Contents  OptiVec home