File Exchange

image thumbnail

Generalized Goertzel algorithm

version (3.14 KB) by Pavel Rajmic
Goertzel algorithm generalized to non-integral multiples of fundamental frequency.


Updated 07 Mar 2012

View Version History

View License

The conventional Goertzel Algorithm can be used to compute individual DFT coefficients. In case we need to compute some values of DTFT (that means, non-integer multiples of the fundamental frequency), slight modification must be done.

There are two files: the conventional and generalized Goertzel algorithm. No toolboxes needed.

The algorithm and its derivation is described in the article accesible at

Cite As

Pavel Rajmic (2021). Generalized Goertzel algorithm (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

Julian Grodzicky


Pavel Rajmic

In help to this function, we state that
... the 'indices' can be non-integer valued in the range 0 to N−1, where N is the length of X.
Actually, the interval from N−1 to N should be included as well!

Hi, Does it take of windowing the data to reduce spectral leakage?

Rajesh Dachiraju

Hi Pavel Rajmic,

Nice code. I want this for n-dimensions. Is there a way to extend this code to multiple, or general n-dimensions. I am extremely interested in this, and would be very helpful for my application, if it can be extended to n-dimensions.


Eric Sampson


very good



Bill Lu

very useful for detecting frequencies that are not integer multiples of 1/N

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!