DSP Master VCL
|
The Discrete Fourier transformation (DFT) for a given frequency.
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.
DFT of a single frequency.
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;
#include "MtxExpr.hpp" #include "MtxVecEdit.hpp" #include "MtxVecTee.hpp" #include "SignalUtils.hpp" void __fastcall TForm1::BitBtn1Click(TObject *Sender) { sVector a; Tone(a,256,5.5/256,0,12.53); //generate a tone with Amplt = 12.53 //And now detect the amplitude at non-integer frequency: ShowMessage("Amplitude = " + SampleToStr(CAbs(Goertz(a,5.5/256))/128)); }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|