IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Meta.Numerics.SignalProcessing.FourierTransformer Class Reference

An engine for performing Fourier transforms on complex series. More...

+ Collaboration diagram for Meta.Numerics.SignalProcessing.FourierTransformer:

Public Member Functions

 FourierTransformer (int size)
 Initializes a new instance of the Fourier transformer. More...
 
 FourierTransformer (int size, FourierSign signConvention, FourierNormalization normalizationConvention)
 Initializes a new instance of the Fourier transformer with the given sign and normalization conventions. More...
 
Complex[] Transform (IList< Complex > values)
 Computes the Fourier transform of the given series. More...
 
Complex[] InverseTransform (IList< Complex > values)
 Computes the inverse Fourier transform of the given series. More...
 

Properties

int Length [get]
 The series length for which the transformer is specialized. More...
 
FourierNormalization NormalizationConvention [get]
 Gets the normalization convention used by the transformer. More...
 
FourierSign SignConvention [get]
 Gets the normalization convention used by the transformer. More...
 

Private Member Functions

int GetSign ()
 

Static Private Member Functions

static void Normalize (Complex[] x, double f)
 

Private Attributes

int size
 
List< Factor > factors
 
List< Transformlet > plan
 
FourierNormalization normalizationConvention
 
FourierSign signConvention
 
Complex[] roots
 

Detailed Description

An engine for performing Fourier transforms on complex 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 FourierTransformer.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
// 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);

Constructor & Destructor Documentation

Meta.Numerics.SignalProcessing.FourierTransformer.FourierTransformer ( int  size)
inline

Initializes a new instance of the Fourier transformer.

Parameters
sizeThe series length of the transformer, which must be positive.

References Meta.Numerics.SignalProcessing.Negative.

Meta.Numerics.SignalProcessing.FourierTransformer.FourierTransformer ( int  size,
FourierSign  signConvention,
FourierNormalization  normalizationConvention 
)
inline

Initializes a new instance of the Fourier transformer with the given sign and normalization conventions.

Parameters
sizeThe series length of the transformer, which must be positive.
signConventionThe sign convention of the transformer.
normalizationConventionThe normalization convention of the transformer.

There are multiple conventions for both the sign of the exponent and the overall normalization of Fourier transforms. The default conventions for some widely used software packages are summarized in the following table.

SoftwareSignNormalization
Meta.NumericsFourierSign.NegativeFourierNormalization.None
MatlabFourierSign.NegativeFourierNormalization.None
MathmaticaFourierSign.PositiveFourierNormalization.Unitary
Numerical RecipiesFourierSign.PositiveFourierNormalization.None

Member Function Documentation

int Meta.Numerics.SignalProcessing.FourierTransformer.GetSign ( )
inlineprivate
static void Meta.Numerics.SignalProcessing.FourierTransformer.Normalize ( Complex[]  x,
double  f 
)
inlinestaticprivate
Complex [] Meta.Numerics.SignalProcessing.FourierTransformer.Transform ( IList< Complex values)
inline

Computes the Fourier transform of the given series.

Parameters
valuesThe series to transform.
Returns
The discrete Fourier transform of the series.
Complex [] Meta.Numerics.SignalProcessing.FourierTransformer.InverseTransform ( IList< Complex values)
inline

Computes the inverse Fourier transform of the given series.

Parameters
valuesThe series to invert.
Returns
The inverse discrete Fourier transform of the series.

Referenced by Test.FourierTest.FourierInverse(), Test.FourierTest.FourierSpecialCases(), and Test.FourierTest.TestMethod1().

Member Data Documentation

int Meta.Numerics.SignalProcessing.FourierTransformer.size
private
List<Factor> Meta.Numerics.SignalProcessing.FourierTransformer.factors
private
List<Transformlet> Meta.Numerics.SignalProcessing.FourierTransformer.plan
private
FourierNormalization Meta.Numerics.SignalProcessing.FourierTransformer.normalizationConvention
private
FourierSign Meta.Numerics.SignalProcessing.FourierTransformer.signConvention
private
Complex [] Meta.Numerics.SignalProcessing.FourierTransformer.roots
private

Property Documentation

int Meta.Numerics.SignalProcessing.FourierTransformer.Length
get

The series length for which the transformer is specialized.

Referenced by Test.FourierTest.FourierSpecialCases().

FourierNormalization Meta.Numerics.SignalProcessing.FourierTransformer.NormalizationConvention
get

Gets the normalization convention used by the transformer.

FourierSign Meta.Numerics.SignalProcessing.FourierTransformer.SignConvention
get

Gets the normalization convention used by the transformer.


The documentation for this class was generated from the following file: