RealFFTResultWrapper Type

Class to provide convenient access to the result of a real valued fourier transform. See remarks for learning about different representations of a real valued Fourier transform.

This class is a wrapper for different representations of the result of a real valued fourier transformation.

1. Real value representation

----------------------------

The first value of the array is the real part of the spectrum at zero frequency, followed by the real part of the spectrum at first frequency and so on. The last value of the array is the imaginary part of the spectrum at first frequency, the value before this is the imaginary part of the spectrum at second frequency and so on. If the length of the fourier transform is even, the value of the array at index of half the length (N/2) is the real part of the spectrum at nyquist frequency. If the length of the fourier transform is odd, there is no value of the spectrum at nyquist frequency.

2. Verbose complex representation

---------------------------------

The real and imaginary part of the spectrum are properly ordered from zero frequency to nyquist frequency. The element at zero frequency contains only the real part, the imaginary part of this element is zero. The element at nyquist frequency contains only the real part at nyquist frequency, the imaginary part of this element is zero. Note that if the length of the FFT is for instance 1024, there are 513 complex spectral values. If the length of the FFT is 1023 (odd), there are 512 complex spectral values.

3. Compact complex representation

---------------------------------

The real and imaginary part of the spectrum are properly ordered from zero frequency to one element below the nyquist frequency. The value at nyquist frequency is put into the imaginary part of the spectrum at zero index. If the length of the FFT is odd, there is no value at nyquist frequency, and hence the imaginary part at zero index is set to zero. If the length of the FFT is for instance 1024, there are 512 complex spectral values. If the length of the FFT is 1023 (odd), there are still 512 complex spectral values, but the imaginary part of the first value is set to zero.

Constructors

Constructor Description

RealFFTResultWrapper(fftresult)

Full Usage: RealFFTResultWrapper(fftresult)

Parameters:
    fftresult : float[] - The result of a real valued fourier transformation.

Constructur. You must provide the array with the result of a real valued fourier transformation.

fftresult : float[]

The result of a real valued fourier transformation.

Instance members

Instance member Description

this.Amplitude

Full Usage: this.Amplitude

Returns: IROVector<float>

Returns the vector of amplitudes, i.e. the modulus of the complex result.

Returns: IROVector<float>

this.CircularFrequenciesFromXIncrement

Full Usage: this.CircularFrequenciesFromXIncrement

Parameters:
    xincrement : float - X interval between two points before the Fourier transformation (sample period).

Returns: IROVector<float> The vector of circular frequencies that correspond to the vectors Amplitude, RealPart, ImaginaryPart and Phase.

Given a value for the xincrement (x interval between two points before the Fourier transformation), the vector of circular frequencies is returned.

xincrement : float

X interval between two points before the Fourier transformation (sample period).

Returns: IROVector<float>

The vector of circular frequencies that correspond to the vectors Amplitude, RealPart, ImaginaryPart and Phase.

this.CircularFrequenciesFromXRate

Full Usage: this.CircularFrequenciesFromXRate

Parameters:
    xrate : float - Inverse of the x interval between two points before the Fourier transformation (sample rate).

Returns: IROVector<float> The vector of circular frequencies that correspond to the vectors Amplitude, RealPart, ImaginaryPart and Phase.

Given a value for the xrate (inverse of x interval between two points before the Fourier transformation), the vector of circular frequencies is returned.

xrate : float

Inverse of the x interval between two points before the Fourier transformation (sample rate).

Returns: IROVector<float>

The vector of circular frequencies that correspond to the vectors Amplitude, RealPart, ImaginaryPart and Phase.

this.ComplexResult

Full Usage: this.ComplexResult

Returns: IROComplexDoubleVector

Returns the vector of the complex result of the FFT.

Returns: IROComplexDoubleVector

this.Count

Full Usage: this.Count

Returns: int

Return the length of the wrapper vectors Amplitude, RealPart, ImaginaryPart and Phase

Returns: int

this.FrequenciesFromXIncrement

Full Usage: this.FrequenciesFromXIncrement

Parameters:
    xincrement : float - X interval between two points before the Fourier transformation (sample period).

Returns: IROVector<float> The vector of frequencies that correspond to the vectors Amplitude, RealPart, ImaginaryPart and Phase.

Given a value for the xincrement (x interval between two points before the Fourier transformation), the vector of frequencies is returned.

xincrement : float

X interval between two points before the Fourier transformation (sample period).

Returns: IROVector<float>

The vector of frequencies that correspond to the vectors Amplitude, RealPart, ImaginaryPart and Phase.

this.FrequenciesFromXRate

Full Usage: this.FrequenciesFromXRate

Parameters:
    xrate : float - Inverse of the x interval between two points before the Fourier transformation (sample rate).

Returns: IROVector<float> The vector of frequencies that correspond to the vectors Amplitude, RealPart, ImaginaryPart and Phase.

Given a value for the xrate (inverse of x interval between two points before the Fourier transformation), the vector of frequencies is returned.

xrate : float

Inverse of the x interval between two points before the Fourier transformation (sample rate).

Returns: IROVector<float>

The vector of frequencies that correspond to the vectors Amplitude, RealPart, ImaginaryPart and Phase.

this.ImaginaryPart

Full Usage: this.ImaginaryPart

Returns: IROVector<float>

Returns the vector of the resulting imaginary parts of the FFT.

Returns: IROVector<float>

this.Phase

Full Usage: this.Phase

Returns: IROVector<float>

Returns the vector of the resulting phases of the FFT.

Returns: IROVector<float>

this.RealPart

Full Usage: this.RealPart

Returns: IROVector<float>

Returns the vector of the resulting real parts of the FFT.

Returns: IROVector<float>

Static members

Static member Description

RealFFTResultWrapper.AddSpectra(spectrumA, spectrumB, result)

Full Usage: RealFFTResultWrapper.AddSpectra(spectrumA, spectrumB, result)

Parameters:
    spectrumA : float[] - The first spectrum to add.
    spectrumB : float[] - The second spectrum to add.
    result : float[] - The resulting of the addition of the two spectras. May be identical to one of the parameters spectraA or spectraB. See remarks on how the data are organized in the array.

Addition of two spectra that where created as the result of two real fourier transformations.

The data in the nominator and denominator spectral array and in the resulting array are organized as follows. a[0] is the real part of f=0 (for f=0 the imaginary part is always zero) a[i] and a[length-i] are the real and imaginary part of the spectrum at frequency i, respectively. If the length of a is even, then a[length/2] is the real part of the frequency length/2 (the imaginary part at this frequency is always zero).

spectrumA : float[]

The first spectrum to add.

spectrumB : float[]

The second spectrum to add.

result : float[]

The resulting of the addition of the two spectras. May be identical to one of the parameters spectraA or spectraB. See remarks on how the data are organized in the array.

RealFFTResultWrapper.DivideSpectra(nominator, denominator, result)

Full Usage: RealFFTResultWrapper.DivideSpectra(nominator, denominator, result)

Parameters:
    nominator : float[] - The spectrum acting as nominator of the division.
    denominator : float[] - The denominator spectrum.
    result : float[] - The resulting divided spectrum. See remarks on how the data are organized in the array.

Divides two spectra that where created as the result of two real fourier transformations.

The data in the nominator and denominator spectral array and in the resulting array are organized as follows. a[0] is the real part of f=0 (for f=0 the imaginary part is always zero) a[i] and a[length-i] are the real and imaginary part of the spectrum at frequency i, respectively. If the length of a is even, then a[length/2] is the real part of the frequency length/2 (the imaginary part at this frequency is always zero).

nominator : float[]

The spectrum acting as nominator of the division.

denominator : float[]

The denominator spectrum.

result : float[]

The resulting divided spectrum. See remarks on how the data are organized in the array.

RealFFTResultWrapper.FromRepresentationCompactComplexToReal(re, im, destination)

Full Usage: RealFFTResultWrapper.FromRepresentationCompactComplexToReal(re, im, destination)

Parameters:
    re : IReadOnlyList<float> - Stores the real part of the spectrum.
    im : IReadOnlyList<float> - Stores the imaginary part of the spectrum.
    destination : IVector<float> - After return, stores the spectrum in normalized real representation. The length of the vector has to be equal to the length of the FFT.

Transforms from a compact complex representation (nyquist frequency value put in imaginary part of first element) to real representation.

re : IReadOnlyList<float>

Stores the real part of the spectrum.

im : IReadOnlyList<float>

Stores the imaginary part of the spectrum.

destination : IVector<float>

After return, stores the spectrum in normalized real representation. The length of the vector has to be equal to the length of the FFT.

RealFFTResultWrapper.FromRepresentationCompactComplexToReal(src, destination)

Full Usage: RealFFTResultWrapper.FromRepresentationCompactComplexToReal(src, destination)

Parameters:
    src : IROComplexDoubleVector - Stores the complex spectrum.
    destination : IVector<float> - After return, stores the spectrum in normalized real representation. The length of the vector has to be equal to the length of the FFT.

Transforms from a compact complex representation (nyquist frequency value put in imaginary part of first element) to real representation.

src : IROComplexDoubleVector

Stores the complex spectrum.

destination : IVector<float>

After return, stores the spectrum in normalized real representation. The length of the vector has to be equal to the length of the FFT.

RealFFTResultWrapper.FromRepresentationRealToCompactComplex(src, destRe, destIm)

Full Usage: RealFFTResultWrapper.FromRepresentationRealToCompactComplex(src, destRe, destIm)

Parameters:
    src : IReadOnlyList<float> - Real representation of the spectrum.
    destRe : IVector<float> - On return, contains the real part of the spectrum.
    destIm : IVector<float> - On return, contains the imaginary part of the spectrum.

Transforms from the real representation of a spectrum to the compact complex representation (nyquist frequency value put in imaginary part of first element).

src : IReadOnlyList<float>

Real representation of the spectrum.

destRe : IVector<float>

On return, contains the real part of the spectrum.

destIm : IVector<float>

On return, contains the imaginary part of the spectrum.

RealFFTResultWrapper.FromRepresentationRealToCompactComplex(src, dest)

Full Usage: RealFFTResultWrapper.FromRepresentationRealToCompactComplex(src, dest)

Parameters:

Transforms from the real representation of a spectrum to the compact complex representation (nyquist frequency value put in imaginary part of first element).

src : IReadOnlyList<float>

Real representation of the spectrum.

dest : IComplexDoubleVector

On return, contains the complex spectrum.