SignalUtils.Goertz Method

Overload List

#SignatureDescription
1void Goertz(TVec Src, TVec Freq, TVec Dst, TGoertzPhaseCorrection PhaseCorrection)The Discrete Fourier transformation (DFT) for vector of frequencies.
2void Goertz(TVec Src, TVec Freq, TVec Dst, Int32 SrcIndex, Int32 srcLen, TGoertzPhaseCorrection PhaseCorrection)The Discrete Fourier transformation (DFT) for vector of frequencies.
3TCplx Goertz(TVec Src, Double Freq, TGoertzPhaseCorrection PhaseCorrection)The Discrete Fourier transformation (DFT) for a given frequency.
4TCplx 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.

#NameTypeDescription
1SrcTVecsource TVec
2FreqTVecsource TVec
3DstTVecsource TVec
4PhaseCorrectionTGoertzPhaseCorrection

Result: stored in self (calling object)

Remarks:

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.

See Also: SignalUtils.Goertz

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.

#NameTypeDescription
1SrcTVecsource TVec
2FreqTVecsource TVec
3DstTVecsource TVec
4SrcIndexInt32source start index
5srcLenInt32
6PhaseCorrectionTGoertzPhaseCorrection

Result: stored in self (calling object)

Remarks:

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.

#NameTypeDescription
1SrcTVecsource TVec
2FreqDoublescalar
3PhaseCorrectionTGoertzPhaseCorrection

Returns: TCplx (complex)

Remarks:

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.

Examples
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));
}
See Also: SignalUtils.GoertzTwo

Overload 4: TCplx Goertz(TVec Src, Double Freq, Int32 SrcIndex, Int32 srcLen, TGoertzPhaseCorrection PhaseCorrection)

The Discrete Fourier transformation (DFT) for a given frequency.

#NameTypeDescription
1SrcTVecsource TVec
2FreqDoublescalar
3SrcIndexInt32source start index
4srcLenInt32
5PhaseCorrectionTGoertzPhaseCorrection

Returns: TCplx (complex)

Remarks:

SrcIndex and srcLen define the sub-range of Src on which to compute the function.