Class FFT2D
Performs two dimensional FFT on a matrix of values.
IMPORTANT: The matrix passed to this class for performing of 2D FFT need not necessarily have width equal to height
but both width and height MUST be a power of two.
Assembly: AudioAnalysisTools.dll
Methods
|
Improve this Doc
View Source
Performs a 2D-Fourier transform on data in the passed Matrix/image.
Declaration
public static double[, ] FFT2Dimensional(double[, ] M)
Parameters
Type |
Name |
Description |
Double[,] |
M |
|
Returns
|
Improve this Doc
View Source
First construct complex sampleData, then calculate the magnitude of sampleData.
Declaration
public static double[, ] FFT2DOutput2MatrixOfMagnitude(double[] sampleData, int[] dims)
Parameters
Returns
|
Improve this Doc
View Source
This method "shifts" (that is, "rearranges") the quadrants of the magnitude matrix generated by the 2DFourierTransform
such that the Top Left quadrant is swapped with the Bottom-Right quadrant
and the Top-Right quadrant is swapped with the Bottom-Left.
This has the effect of shifting the low frequency coefficients into the centre of the matrix and the high frequency
coefficients are shifted to the edge of the image.
Declaration
public static double[, ] fftShift(double[, ] matrix)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
|
Returns
|
Improve this Doc
View Source
reads an image into a matrix.
Takes weighted average of the RGB colours in each pixel.
Declaration
public static double[, ] GetImageDataAsGrayIntensity(string imageFilePath, bool reversed)
Parameters
Returns
|
Improve this Doc
View Source
Concatenates the columns of the passed matrix and inserts zeros in every second position.
The matrix is assumed to be an image and therefore read it using image coordinates.
The output vector is now a vector of Complex numbers, with the imaginary part set to 0.
Declaration
public static Complex[] Matrix2ComplexVector(double[, ] M)
Parameters
Type |
Name |
Description |
Double[,] |
M |
The input matrix.
|
Returns
Type |
Description |
Complex[] |
A flattened M as a vactor.
|
|
Improve this Doc
View Source
Concatenates the columns of the passed matrix and inserts zeros in every second position.
The matrix is assumed to be an image and therefore read it using image coordinates.
The output vector is now assumed to be a vector of Complex numbers,
with the real values in the even positions and the imaginary numbers in the odd positions.
Declaration
public static double[] Matrix2PaddedVector(double[, ] M)
Parameters
Type |
Name |
Description |
Double[,] |
M |
|
Returns
|
Improve this Doc
View Source
METHOD to TEST the FFT2D.
Declaration
public static void TestFFT2D()
Extension Methods