Overload List
| # | Signature | Description |
|---|---|---|
| 1 | procedure Goertz(const Src: TVec; const Freq: TVec; const Dst: TVec; PhaseCorrection: TGoertzPhaseCorrection); | The Discrete Fourier transformation (DFT) for vector of frequencies. |
| 2 | procedure Goertz(const Src: TVec; const Freq: TVec; const Dst: TVec; const SrcIndex: Integer; srcLen: Integer; PhaseCorrection: TGoertzPhaseCorrection); | The Discrete Fourier transformation (DFT) for vector of frequencies. |
| 3 | function Goertz(const Src: TVec; Freq: Double; PhaseCorrection: TGoertzPhaseCorrection): TCplx; | The Discrete Fourier transformation (DFT) for a given frequency. |
| 4 | function Goertz(const Src: TVec; Freq: Double; const SrcIndex: Integer; srcLen: Integer; PhaseCorrection: TGoertzPhaseCorrection): TCplx; | The Discrete Fourier transformation (DFT) for a given frequency. |
Overload 1: procedure Goertz(const Src: TVec; const Freq: TVec; const Dst: TVec; PhaseCorrection: TGoertzPhaseCorrection);
The Discrete Fourier transformation (DFT) for vector of frequencies.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | |
| 2 | Freq | TVec | |
| 3 | Dst | 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: procedure Goertz(const Src: TVec; const Freq: TVec; const Dst: TVec; const SrcIndex: Integer; srcLen: Integer; PhaseCorrection: TGoertzPhaseCorrection);
The Discrete Fourier transformation (DFT) for vector of frequencies.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | |
| 2 | Freq | TVec | |
| 3 | Dst | TVec | |
| 4 | SrcIndex | Integer | source start index |
| 5 | srcLen | Integer | |
| 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: function Goertz(const Src: TVec; Freq: Double; PhaseCorrection: TGoertzPhaseCorrection): TCplx;
The Discrete Fourier transformation (DFT) for a given frequency.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | 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.
uses MtxExpr, Math387, MtxVec, SignalUtils, MtxVecTee, MtxVecEdit;
procedure TForm1.Button1Click(Sender: TObject);
var a: Vector;
begin
Tone(a,256,5.5/256,0,12.53); //generate a tone
//And now detect the amplitude at non-integer frequency:
ShowMessage('Amplitude = ' + SampleToStr(CAbs(Goertz(a,5.5/256))/128));
end;
Overload 4: function Goertz(const Src: TVec; Freq: Double; const SrcIndex: Integer; srcLen: Integer; PhaseCorrection: TGoertzPhaseCorrection): TCplx;
The Discrete Fourier transformation (DFT) for a given frequency.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVec | |
| 2 | Freq | Double | scalar |
| 3 | SrcIndex | Integer | source start index |
| 4 | srcLen | Integer | |
| 5 | PhaseCorrection | TGoertzPhaseCorrection |
Returns: TCplx (complex)
SrcIndex and srcLen define the sub-range of Src on which to compute the function.