Get frequency domain with Goertzel algorithm

I used this code:

public double goertzel(List<double> sngData, long N, float frequency, int samplerate) { double skn, skn1, skn2; skn = skn1 = skn2 = 0; samplerate = this.sampleRate; frequency = this.freq; double c = 2 * pi * frequency / samplerate; double cosan = Math.Cos(c); for (int i = 0; i < N; i++) { skn2 = skn1; skn1 = skn; skn = 2 * cosan * skn1 - skn2 + sngData[i]; } return skn - Math.Exp(-c) * skn1; } 

After using this function when processing audio data, what should I do next to get the frequency domain with this algorithm?

0
source share
1 answer

The Goertzel algorithm is designed to determine the intensity (magnitude) of a certain frequency. Frequency is an input parameter.

To get the frequency spectrum of an audio signal (intensity, if the frequency range), you need to execute the Goertzel algorithm for a large series of frequencies, but it would be wise to do one Fourier transform to get similar results.
We can say that the Goertzel algorithm finds one sample of discrete FT.

+1
source

All Articles