2
$\begingroup$

Why is Goertzel Algorithm considered a block algorithm? Given that my input is bounded, couldn't I just run it forever (taking every sample that comes out after some length N) given a big enough word size for the intermediate coefficients?

I understand that I would get rectangular window spectral leakage, which may not be desirable, but let's assume it is good enough. If my input signal is stationary, then eventually I should get fairly good spectral resolution, correct?

But what if it isn't stationary? What is the memory of the Goertzel algorithm? How fast does the input signal frequency need to change before I get garbage results?

$\endgroup$
2
  • 1
    $\begingroup$ i agree with you. i consider the Goertzel Algorithm to be little other than correlating with a sinusoid and LPFing that result. it's essentially this filter: $$\begin{align} \frac{Y(z)}{X(z)} & = \frac{(1 - e^{-j \omega_0}z^{-1})}{(1 - e^{+j \omega_0} z^{-1})(1 - e^{-j \omega_0} z^{-1})} \\ & = \frac{1}{1 - e^{+j \omega_0} z^{-1}} \\ & = \frac{z}{z - e^{+j \omega_0}} \\ \end{align}$$ you can check it out here $\endgroup$ Apr 24, 2016 at 1:13
  • $\begingroup$ “given a big enough word size for the intermediate coefficients”—that's a practically unachievable part. The number of bits required to store precise state variables blows up very quickly. The IIR stage with the 2 poles exactly on the unit circle is marginally stable (this is the definition of marginal stability), and therefore the impulse response is in fact infinite. (The zero-cancelling conjugate pole is not used till the last sample, when a FIR of length 1 is applied). For all practical purposes, the only way to keep it from blowing up is use short blocks. I'm not a fan of it, really. $\endgroup$ Jul 10, 2020 at 0:13

1 Answer 1

2
$\begingroup$

You can use forms of the Goertzel algorithm as a fixed length block filter, as a IIR filter with a very long impulse response, or as a fixed length running filter.

As a fixed length filter, a Goertzel results in a FIR filter similar (almost identical) to the result of 1 bin of a DFT or FFT of the same length.

As an IIR filter, a Goertzel filter is on the edge on instability (pole right on the unit circle), so you may need to bound the filter state and/or output externally, or reduce the gain slightly below 1.0.

As a fixed length running filter, you subtract the output of 2 offset (but stabilized) Goertzel IIR filters to get a FIR filter or 1 bin of a DFT (length equaling the offset) that updates every input sample, and with very few MACs per sample.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.