Dew MtxVec NET
TMtx.FFT2DFromReal Methods
Summary
Forward two-dimentional Fast Fourier Transformation for real numbers.

Class
TMtx

Declaration
Function FFT2DFromReal: TMtx;

Description
The transformation is applied in-place. The source matrix must be real. An exception will be raised, if the source matrix is complex. The calling matrix stays real and does not change it's size, if TDenseMtxVec.FFTStorageFormat was set to fsfPack or to fsfPerm. If the TDenseMtxVec.FFTStorageFormat property was set to fsfCCS then the calling matrix becomes complex and is resized up to [Rows, Cols div 2], i.e. matrix changes TMtxVec.Complex property, but does not reallocate storage for elements. The number of element which are involved in the transformation depends on the property TDenseMtxVec.FFTStorageFormat. If that property is set to fsfPerm or to fsfPack, then all elements are involved into the trasformation. If that property is set to fsfCCS (which is default), then number of element which are involved into the transformation depends on the property TDenseMtxVec.FFTOddLength and these rules will be followed:

- Number of source columns must be even and more then two. Number of source rows must be more than two. Exception will be raised otherwise;
- if TDenseMtxVec.FFTOddLength is set to False, elements from range [0..Cols-2] x [0..Rows-2] will be involved into transformation;
- if TDenseMtxVec.FFTOddLength is set to True, elements from range [0..Cols-1] x [0..Rows-2] will be involved into transformation;
NOTE:Not all source elements are involved into transformation but all elements in the result matrix are needed for the inverse transformation.

 See Also 
FFT2D 
IFFT2D 
IFFT2DFromReal 

Example 1

var a: TMtx; begin CreateIt(a); try a.SetIt (4,4,False, [1, 2, 3, 4, -5, 6, -7, 8, 9, 12,-11, 10, 16,-15,-14, 0]); a.FFTStorageFormat := fsfCCS; a.FFTOddLength := False; // the next elements are involved into transformation [1, 2, -5, 6] a.FFT2DFromReal; // result will be // [(4,0), (-12,0), // (0,0), (0,0), // (2,12), (10,10), // (0,-15), (0,0)] // after inverse transformation (a.IFFT2DToReal) only elements in range // [0..Col-2] x [0..Rows-2] will be reconstructed, other elements will be undefined // [1, 2, undef, undef, // -5, 6, undef, undef, // undef, undef, undef, undef, // undef, undef, undef, undef] // // if a.FFTOddLength is set to true, // then the range of reconstruction would be [0..Col-1] x [0..Rows-2]. finally FreeIt(a); end; end;


Declaration
Function FFT2DFromReal(Mtx: TMtx): TMtx;
Summary
Forward two-dimentional Fast Fourier Transformation from real to complex.
Description
The transformation is applied on the Mtx matrix and results are saved in the calling matrix. The Mtx matrix must be real. And exception will be raised if the source matrix is complex. The source matrix will not be changed. The calling matrix will be real and will be resized up to [Mtx.Rows,Mtx.Cols], if
TDenseMtxVec.FFTStorageFormat is set to fsfPack or to fsfPack. If TDenseMtxVec.FFTStorageFormat is set to fsfCCS, calling matrix will be complex and will be resized up to [Mtx.Rows, Mtx.Cols div 2]. The number of element which are involved in transformation depends on the property TDenseMtxVec.FFTStorageFormat. If that property is set to fsfPerm or to fsfPack, then all the source elements are involved into the trasformation. If that property is set to fsfCCS (which is default), then the number of elements which are involved into the transformation depends on the property TDenseMtxVec.FFTOddLength and these rules will be followed:

- Number of source columns must be even and more then two. Number of source rows must be more than two. Exception will be raised otherwise;
- if TDenseMtxVec.FFTOddLength is set to False, elements from range [0..Mtx.Cols-2] x [0..Mtx.Rows-2] will be involved into transformation;
- if TDenseMtxVec.FFTOddLength is set to True, elements from range [0..Mtx.Cols-1] x [0..Mtx.Rows-2] will be involved into transformation;
NOTE:Not all source elements are involved into transformation but all elements in the result matrix are needed for the inverse transformation.

 See Also 
FFT2D 
IFFT2D 
IFFT2DFromReal 

Copyright 2008 Dew Research
http://www.dewresearch.com