IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
An engine for performing Fourier transforms on complex series. More...
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 |
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.
|
inline |
Initializes a new instance of the Fourier transformer.
size | The series length of the transformer, which must be positive. |
References Meta.Numerics.SignalProcessing.Negative.
|
inline |
Initializes a new instance of the Fourier transformer with the given sign and normalization conventions.
size | The series length of the transformer, which must be positive. |
signConvention | The sign convention of the transformer. |
normalizationConvention | The 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.
Software | Sign | Normalization |
---|---|---|
Meta.Numerics | FourierSign.Negative | FourierNormalization.None |
Matlab | FourierSign.Negative | FourierNormalization.None |
Mathmatica | FourierSign.Positive | FourierNormalization.Unitary |
Numerical Recipies | FourierSign.Positive | FourierNormalization.None |
|
inlineprivate |
|
inlinestaticprivate |
|
inline |
Computes the Fourier transform of the given series.
values | The series to transform. |
|
inline |
Computes the inverse Fourier transform of the given series.
values | The series to invert. |
Referenced by Test.FourierTest.FourierInverse(), Test.FourierTest.FourierSpecialCases(), and Test.FourierTest.TestMethod1().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
get |
The series length for which the transformer is specialized.
Referenced by Test.FourierTest.FourierSpecialCases().
|
get |
Gets the normalization convention used by the transformer.
|
get |
Gets the normalization convention used by the transformer.