Cycle Detection Methods Compared: FFT, Goertzel, Wavelets
Not all spectral analysis is equal. Compare the major cycle detection algorithms and when to use each.
About this content: This page describes observable market structure through the Fractal Cycles framework. It does not provide forecasts, recommendations, or trading instructions.
When you want to find cycles in price data, you need a mathematical tool that decomposes the signal into its frequency components. Several methods exist, each with distinct trade-offs in accuracy, computational efficiency, and suitability for financial data. Before exploring these methods, it helps to understand the broader context of spectral analysis in market analysis — the conceptual framework that all these methods share.
Fast Fourier Transform (FFT)
The FFT is the most well-known spectral analysis tool. It decomposes a signal into all its constituent frequencies simultaneously, producing a complete power spectrum in a single computation.
Strengths:
- Complete frequency spectrum in one computation
- Highly optimized implementations widely available
- Well-understood mathematical properties
- Good for exploratory analysis — see everything at once
- Computationally efficient for large datasets (O(N log N) complexity)
Weaknesses:
- Assumes stationarity (cycle frequencies constant over time)
- Requires power-of-2 sample sizes for best efficiency (can be padded with zeros)
- Computes many frequencies you don't care about
- Spectral leakage can smear peaks, making it harder to resolve closely spaced cycles
- Frequency resolution is fixed by the sample length — you cannot zoom in on a region of interest
Best for: Initial exploration when you don't know what cycles exist and want a broad overview.
Goertzel Algorithm
The Goertzel algorithm computes the power at specific target frequencies rather than the entire spectrum. It is essentially a single-frequency DFT, evaluated one frequency at a time.
Strengths:
- Efficient when you only need specific frequencies (O(N) per frequency)
- Works with any sample size — no power-of-2 requirement
- Numerically stable for the frequency ranges typical in market analysis
- Perfect for scanning a defined range of cycle periods
- Can evaluate non-integer frequencies, providing finer frequency resolution than FFT
Weaknesses:
- Must specify which frequencies to calculate — not exploratory
- Slower than FFT if you need many frequencies (crossover around N/2 frequencies)
- Still assumes stationarity within the analysis window
Best for: Production cycle detection when scanning known frequency ranges. This is the method we use at FractalCycles.
Wavelet Transform
Wavelets analyze signals in both time and frequency simultaneously. They decompose the signal using scaled and shifted versions of a "mother wavelet" — a template oscillation that is compared against the data at different scales and positions.
Strengths:
- Handles non-stationary signals — cycles that change frequency over time
- Shows when cycles are present and when they fade
- Good for evolutionary analysis of market structure
- Produces a time-frequency representation (scalogram) that reveals structural changes
Weaknesses:
- More complex to implement and interpret correctly
- Choice of mother wavelet affects results — no single "correct" choice
- Heisenberg-like trade-off between time and frequency resolution
- Often overkill for practical applications where a snapshot spectrum suffices
- Computationally more expensive than Goertzel for focused analysis
Best for: Research into how cycle structure evolves over time. Less practical for real-time analysis but excellent for understanding structural transitions.
Other Methods
Maximum Entropy Method (MEM): Produces higher resolution spectral estimates from shorter data segments by modeling the data as an autoregressive process. Good for limited data but can produce spurious peaks that do not correspond to real cycles. Requires careful selection of model order.
MUSIC/ESPRIT: Parametric methods that assume a specific number of sinusoids are present in the data. They achieve very high frequency resolution but require prior knowledge of how many cycles exist — a chicken-and-egg problem in exploratory analysis.
Hilbert Transform: Computes instantaneous frequency and amplitude from the analytic signal. Useful for analyzing the evolution of a single cycle but struggles when multiple overlapping cycles are present, which is typical in market data.
Lomb-Scargle periodogram: Designed for unevenly sampled data. Useful when market data has gaps (weekends, holidays) and you do not want to interpolate. Produces results similar to FFT but handles irregular sampling natively.
Method Comparison Framework
When selecting a cycle detection method, several factors should guide the decision. The following framework organizes the key trade-offs:
- Data characteristics: Is the data evenly sampled? How long is the series? Are there gaps? Evenly sampled data of moderate length favors Goertzel or FFT. Short data favors MEM. Gapped data favors Lomb-Scargle.
- Analysis goal: Are you exploring (what cycles exist?) or confirming (is a specific cycle present?)? Exploration favors FFT for breadth. Confirmation favors Goertzel for precision and efficiency.
- Stationarity assumption: Do you believe cycle frequencies are roughly constant within your analysis window? If yes, FFT or Goertzel work well. If cycles are evolving, wavelets provide the time-varying perspective.
- Computational constraints: Do you need real-time analysis on many instruments? Goertzel is most efficient for focused scanning. FFT is efficient for complete spectra. Wavelets and MEM are more computationally demanding.
Detect hidden cycles in any market
See which cycle periods are statistically significant in any market data — run a free analysis with our robust cycle detection software.
Try it freeComputational Considerations
For practical applications processing many instruments, computational efficiency matters. Here is how the methods compare:
FFT: O(N log N) for a complete spectrum. Very fast for large N. However, if you only need K specific frequencies where K is much less than N, it computes unnecessary frequencies. For N = 1000 and K = 50, FFT computes about 500 frequency bins when you only need 50.
Goertzel: O(N) per frequency, so O(NK) total. For K = 50 and N = 1000, this is 50,000 operations versus FFT's roughly 10,000. However, Goertzel avoids the overhead of FFT setup and complex number handling, so the real-world crossover point is around K = N/2. For typical cycle scanning (50-100 target periods), Goertzel is competitive or faster.
Wavelets: O(N) per scale with fast wavelet transform, but producing a full time-frequency map requires O(N * number_of_scales) operations and stores a 2D matrix rather than a 1D spectrum. More memory and computation than Goertzel or FFT for focused analysis.
Validation Approaches
Regardless of which detection method you choose, validation is essential. Detected cycles must be tested for statistical significance to separate genuine structure from noise. The Bartels test is our preferred validation method because it directly tests the question that matters: does this cycle produce consistent price behavior at the same phase positions?
Other validation approaches include:
- Out-of-sample testing: Detect cycles on one portion of data and verify they persist in a different portion. Cycles that appear only in-sample are likely noise or overfitting.
- Multi-method agreement: Run multiple detection methods and look for cycles that appear in all of them. Agreement across methods increases confidence. A cycle detected by both Goertzel and FFT is more likely genuine than one detected by only one method.
- Harmonic consistency: Genuine cycles often appear with harmonic relatives (2:1 period ratios). If you detect a 40-bar cycle, look for a 20-bar or 80-bar companion. Harmonic structure suggests real cycle nesting rather than noise.
- Temporal persistence: Re-run detection at different time points. A cycle that appears consistently across multiple non-overlapping analysis windows is more trustworthy than one that appears sporadically.
Our Approach
At FractalCycles, we use Goertzel for production cycle detection because:
- We scan a defined range of cycle periods (typically 5-200 bars)
- Goertzel is efficient for this focused scanning approach
- We combine with Bartels testing for statistical validation
- The method supports non-integer frequency evaluation for finer resolution
- Simpler implementation reduces complexity and maintenance burden
FFT is useful for initial research; wavelets for understanding cycle evolution. But for production analytical applications, Goertzel's combination of efficiency, flexibility, and simplicity is the most practical choice. The method handles the core detrended signal analysis, after which Bartels validation separates genuine cycles from noise artifacts.
Practical Selection Guide
Use this decision framework to select the appropriate method for your needs:
- Need a complete spectrum overview? → Use FFT for its computational efficiency on full spectra
- Need specific frequencies evaluated? → Use Goertzel for focused, efficient scanning
- Cycles changing over time? → Consider wavelets for time-varying analysis
- Very short data (under 100 bars)? → Consider MEM (with caution regarding spurious peaks)
- Unevenly sampled data? → Consider Lomb-Scargle for native gap handling
- Production analytical system? → Goertzel plus Bartels validation is typically the most practical combination
The method matters less than the validation. A well-validated cycle detected by any method is more valuable than an unvalidated cycle detected by the most sophisticated method. Focus on validation rigor as the primary quality criterion, and let practical considerations (data characteristics, computational constraints, analysis goals) guide method selection.
Framework: This analysis uses the Fractal Cycles Framework, which identifies market structure through spectral analysis rather than narrative explanation.
Written by Ken Nobak
Market analyst specializing in fractal cycle structure
Disclaimer
This content is for educational purposes only and does not constitute financial, investment, or trading advice. Past performance does not guarantee future results. The analysis presented describes observable market structure and should not be interpreted as predictions, recommendations, or signals. Always conduct your own research and consult with qualified professionals before making trading decisions.
See cycles in your own data
Apply the Fractal Cycles framework to any market using our analysis tools. Start with a free account.