# What is the difference between Goertzel algorithm and cross correlation in time

Im reading https://en.wikipedia.org/wiki/Goertzel_algorithm, when we want to discover the amplitude of a some frequency in a given signal what is the difference between applying Goertzel algorithm and doing cross-correlation in time between our signal and a complex exponential with the desired frequency. It seems like in the button line Goertzel algorithm does exactly that, then why couldn't we apply the correlation in the first place and instead used the IIR filter ?

Thank you.

• a) This isn't an IIR filter. b) just because it's called Goertzel, it doesn't mean it's not a correlation! – Marcus Müller Jan 22 at 16:21
• But when we come to implement it, we don't simple do correlation in the sense of doing sum over the signal and the exponent but rather apply the Goertzel filter. – Dannynis Jan 22 at 16:32
• I don't understand your point "applying the Goertzel filter" is doing the sum over the signal and the exponent?! – Marcus Müller Jan 22 at 16:33
• I claim "applying the Goertzel filter" and "doing the sum over the signal and the exponent" are NOT the same (the "algorithm" is different, but as explained in Wikipedia their result would be almost equal, so why using the first is preferable ? – Dannynis Jan 22 at 16:38
• but it is the same. Please explain how they are different. The result is literally the same. – Marcus Müller Jan 22 at 16:48

The Goertzel algorithm gets away without calculating a complex product with $$e^{j\pi lk}$$ n times; thus drastically reducing the computational complexity.