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.
Constructor | Description |
Full Usage:
RealFFTResultWrapper(fftresult)
Parameters:
float[]
-
The result of a real valued fourier transformation.
|
Constructur. You must provide the array with the result of a real valued fourier transformation.
|
Instance member | Description |
|
Returns the vector of amplitudes, i.e. the modulus of the complex result.
|
Full Usage:
this.CircularFrequenciesFromXIncrement
Parameters:
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.
|
Full Usage:
this.CircularFrequenciesFromXRate
Parameters:
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.
|
|
Returns the vector of the complex result of the FFT.
|
Full Usage:
this.Count
Returns: int
|
Return the length of the wrapper vectors Amplitude, RealPart, ImaginaryPart and Phase
|
Full Usage:
this.FrequenciesFromXIncrement
Parameters:
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.
|
Full Usage:
this.FrequenciesFromXRate
Parameters:
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.
|
|
Returns the vector of the resulting imaginary parts of the FFT.
|
|
Returns the vector of the resulting phases of the FFT.
|
|
Returns the vector of the resulting real parts of the FFT.
|
Static member | Description |
Full Usage:
RealFFTResultWrapper.AddSpectra(spectrumA, spectrumB, result)
Parameters:
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).
|
Full Usage:
RealFFTResultWrapper.DivideSpectra(nominator, denominator, result)
Parameters:
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).
|
Full Usage:
RealFFTResultWrapper.FromRepresentationCompactComplexToReal(re, im, destination)
Parameters:
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.
|
Full Usage:
RealFFTResultWrapper.FromRepresentationCompactComplexToReal(src, destination)
Parameters:
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.
|
Full Usage:
RealFFTResultWrapper.FromRepresentationRealToCompactComplex(src, destRe, destIm)
Parameters:
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).
|
Full Usage:
RealFFTResultWrapper.FromRepresentationRealToCompactComplex(src, dest)
Parameters:
IReadOnlyList<float>
-
Real representation of the spectrum.
dest : IComplexDoubleVector
-
On return, contains the complex spectrum.
|
Transforms from the real representation of a spectrum to the compact complex representation (nyquist frequency value put in imaginary part of first element).
|