Stock Market Cycles

Stock Market Cycles

Code, Scripts & Indicators

Goertzel Fourier Transform (DFT) Source Code

Cycle detection using discrete Goertzel Fourier transform (+ Video)

Lars von Thienen's avatar
Lars von Thienen
Nov 13, 2023
∙ Paid

This article provides source code for the Goertzel algorithm to compute individual terms of the discrete Fourier transform. The first form provides the standard Goertzel loop. The second form provides a generalized version for the case of non-integer frequency values.

The Goertzel algorithm provides a flexible and improved way to apply cycle analysis to time series datasets. Please watch my cycles course for benefits and background using standard FFT, Goertzel and generalized Goertzel algorithms:

Show Video Course

Further reading & references:
» Reference to Goertzel algorithm: Wikipedia on Goertzel

» Sysel, P., Rajmic, P. Goertzel algorithm generalized to non-integer multiples of fundamental frequency. EURASIP J. Adv. Signal Process. 2012, 56 (2012). https://doi.org/10.1186/1687-6180-2012-56

Source code section

Code is provided in .NET C# language.

User's avatar

Continue reading this post for free, courtesy of Lars von Thienen.

Or purchase a paid subscription.
© 2025 Lars von Thienen · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture