0% found this document useful (0 votes)
3 views

Goertzel Algorithm (C) - LiteratePrograms

The Goertzel algorithm is a digital signal processing technique for identifying specific frequency components of a signal, introduced by Dr. Gerald Goertzel in 1958. Unlike the Fast Fourier Transform (FFT), it focuses on predetermined frequency points. The document includes a C implementation of the algorithm and provides a link for downloading the code.

Uploaded by

Porco Utah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Goertzel Algorithm (C) - LiteratePrograms

The Goertzel algorithm is a digital signal processing technique for identifying specific frequency components of a signal, introduced by Dr. Gerald Goertzel in 1958. Unlike the Fast Fourier Transform (FFT), it focuses on predetermined frequency points. The document includes a C implementation of the algorithm and provides a link for downloading the code.

Uploaded by

Porco Utah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Goertzel algorithm (C) - LiteratePrograms Page 1

Goertzel algorithm (C)


FromLiteratePrograms

The Goertzelalgorithmis a digital signalprocessing(DSP) techniquefor identifyingfrequencycomponentsof a signal, publishedby Dr. GeraldGoertzelin 1958. While the generalFast Fouriertransform(FFT) algorithmcomputesevenly across the bandwidthof the
incomingsignal, the Goertzelalgorithmlooks at specific, predeterminedpoints. For moreinformationsee the Wikipediaarticle (http://en.wikipedia.org/wiki/Goertzel_ algorithm) .

Main algorithm
<<goertzel>>=
float goertzel(float freq, int size, const float x[])
{
int i;
float coeff;
float s, s_prev1 = 0.0f, s_prev2 = 0.0f;

coeff = 2.0f * cosf(2.0f * M_PI * freq);

for (i = 0; i < size; i++) {


s = x[i] + (coeff * s_prev1) - s_prev2;
s_prev2 = s_prev1;
s_prev1 = s;
}

return (s_prev1 * s_prev1) + (s_prev2 * s_prev2)


- (s_prev1 * s_prev2 * coeff);
}

<<goertzel.c>>=
#include <math.h>

goertzel

Download code (http://en.literateprograms.org/Special:Downloadcode/Goertzel_algorithm_%28C%29)


Retrievedfrom"http://en.literateprograms
.org/Goertzel_ algorithm_%28C%29"

Category: Digitalsignalprocessing

This page has been accessed 5,791 times.


Content is available under the MIT/X11 License.

Privacy policy
About LiteratePrograms
Disclaimers

You might also like