Click or drag to resize

FourierTransformer Class

An engine for performing Fourier transforms on complex series.
Inheritance Hierarchy

Namespace:  Meta.Numerics.SignalProcessing
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
public sealed class FourierTransformer

The FourierTransformer type exposes the following members.

Public methodFourierTransformer(Int32)
Initializes a new instance of the Fourier transformer.
Public methodFourierTransformer(Int32, FourierSign, FourierNormalization)
Initializes a new instance of the Fourier transformer with the given sign and normalization conventions.
Public propertyLength
The series length for which the transformer is specialized.
Public propertyNormalizationConvention
Gets the normalization convention used by the transformer.
Public propertySignConvention
Gets the normalization convention used by the transformer.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInverseTransform
Computes the inverse Fourier transform of the given series.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTransform
Computes the Fourier transform of the given series.

A Fourier transform decomposes a function into a sum of different frequency components. This is useful for a wide array of applications.

Mathematically, the DFT is an N-dimensional linear transfromation with coefficients that are the Nth complex roots of unity.

An instance of the FourierTransformer class performs DFTs on series of a particular length, given by its Length property. This specialization allows certain parts of the DFT calculation, which are indepdent of the transformed series but dependent on the length of the series, to be performed only once and then re-used for all transforms of that length. This saves time and improves performance. If you need to perform DFTs on series with different lengths, simply create a seperate instance of the FourierTransform class for each required length.

Many simple DFT implementations require that the series length be a power of two (2, 4, 8, 16, etc.). Meta.Numerics supports DFTs of any length. Our DFT implementation is fast -- order O(N log N) -- for all lengths, including lengths that have large prime factors.


The following code performs a simple DFT and then inverts it to re-obtain the original data.

// Create a Fourier transformer for length-6 series
FourierTransformer ft = new FourierTransformer(6);
// Create a length-6 series and transform it
Complex[] x = new Complex[] { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 };
Complex[] xt = ft.Transform(x);
// Re-use the same transformer to transform a different  series
Complex[] y = new Complex[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
Complex[] yt = ft.Transform(y);
// Transform them back
Complex[] xtt = ft.InverseTransform(xt);
Complex[] ytt = ft.InverseTransform(yt);
See Also