Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void Goertz(TVec Src, TVec Freq, TVec Dst, TGoertzPhaseCorrection PhaseCorrection) | The Discrete Fourier transformation (DFT) for vector of frequencies. |
| 2 | void Goertz(TVec Src, TVec Freq, TVec Dst, Int32 SrcIndex, Int32 srcLen, TGoertzPhaseCorrection PhaseCorrection) | The Discrete Fourier transformation (DFT) for vector of frequencies. |
| 3 | TCplx Goertz(TVec Src, Double Freq, TGoertzPhaseCorrection PhaseCorrection) | The Discrete Fourier transformation (DFT) for a given frequency. |
| 4 | TCplx Goertz(TVec Src, Double Freq, Int32 SrcIndex, Int32 srcLen, TGoertzPhaseCorrection PhaseCorrection) | The Discrete Fourier transformation (DFT) for a given frequency. |
Overload 1: void Goertz(TVec Src, TVec Freq, TVec Dst, TGoertzPhaseCorrection PhaseCorrection)
The Discrete Fourier transformation (DFT) for vector of frequencies.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | source TVec |
| 2 | Freq | TVec | source TVec |
| 3 | Dst | TVec | source TVec |
| 4 | PhaseCorrection | TGoertzPhaseCorrection |
Result: stored in self (calling object)
Calculates the Discrete Fourier transformation (DFT) for an array of frequencies defined in the Freq parameter. Goertz returns the DFT of the frequencies pass as a parameter in the Dst variable. Each value of the DFT computed by the Goertzel algorithm takes 2N+2 real multiplications and 4N real additions. FFT computes the DFT with N*log2(N) of real multiplications and additions.
The Goertz method is faster, than direct DFT, if we need values at consecutively different frequencies. If at every call the values in Freq parameter are different. If the frequencies, at which we need to evalute the spectrum are fixed between calls, then the direct DFT method is faster.
Overload 2: void Goertz(TVec Src, TVec Freq, TVec Dst, Int32 SrcIndex, Int32 srcLen, TGoertzPhaseCorrection PhaseCorrection)
The Discrete Fourier transformation (DFT) for vector of frequencies.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | source TVec |
| 2 | Freq | TVec | source TVec |
| 3 | Dst | TVec | source TVec |
| 4 | SrcIndex | Int32 | source start index |
| 5 | srcLen | Int32 | |
| 6 | PhaseCorrection | TGoertzPhaseCorrection |
Result: stored in self (calling object)
SrcIndex and srcLen define the sub-range of Src on which to compute the function.
Overload 3: TCplx Goertz(TVec Src, Double Freq, TGoertzPhaseCorrection PhaseCorrection)
The Discrete Fourier transformation (DFT) for a given frequency.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | source TVec |
| 2 | Freq | Double | scalar |
| 3 | PhaseCorrection | TGoertzPhaseCorrection |
Returns: TCplx (complex)
Calculates the Discrete Fourier transformation (DFT) for a given frequency. Goertz returns the DFT at the Frequency. Each value of the DFT computed by the Goertzel algorithm takes 2N+2 real multiplications and 4N real additions. FFT computes the DFT with N*log2(N) of real multiplications and additions.
The Goertz method is faster, than direct DFT, if we need values at consecutively different frequencies. At every call the Freq parameter is different.
If the frequencies, at which we need to evalute the spectrum are fixed, then the direct DFT method is faster than Goertz.
The function applies Bonzanigo's phase correction. This means, that phase information is reliable and correct also when computed at an arbitrary non-integer frequency. An "integer frequency" is such that an (exact) integer number of periods fits in to the data (signal) of the specific length.
using Dew.Math;
using Dew.Math.Editors;
using Dew.Math.Units;
using Dew.Signal;
using Dew.Signal.Units;
using Dew.Math.Tee;
using Dew.Signal.Tee;
private void button1_Click(object sender, EventArgs e)
{
Vector a = new Vector(0);
SignalUtils.Tone(a,256,5.5/256,0,12.53,false); //generate a tone
//And now detect the amplitude at non-integer frequency:
MessageBox.Show("Amplitude = " + Math387.SampleToStr(Math387.CAbs(SignalUtils.Goertz(a,5.5/256))/128,0,15));
}
Overload 4: TCplx Goertz(TVec Src, Double Freq, Int32 SrcIndex, Int32 srcLen, TGoertzPhaseCorrection PhaseCorrection)
The Discrete Fourier transformation (DFT) for a given frequency.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | source TVec |
| 2 | Freq | Double | scalar |
| 3 | SrcIndex | Int32 | source start index |
| 4 | srcLen | Int32 | |
| 5 | PhaseCorrection | TGoertzPhaseCorrection |
Returns: TCplx (complex)
SrcIndex and srcLen define the sub-range of Src on which to compute the function.