# Real Time Goertzel Algorithm

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?

• 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 Apr 24 '16 at 1:13
• “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.
– kkm
Jul 10 '20 at 0:13