You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TMtx Class > TMtx Methods > FFT2DFromReal Method > TMtx.FFT2DFromReal Method ()
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TMtx.FFT2DFromReal Method ()

Forward two-dimentional Fast Fourier Transformation for real numbers.

Syntax
C#
Visual Basic
public TMtx FFT2DFromReal();

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.ComplexComplexproperty, 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.

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;
Copyright (c) 1999-2022 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!