2019issue C0648-55
Building a three-harmonic Fourier series cycle wave
A published Fourier analysis construction assembles a composite cycle wave from one Fundamental period, three second-order bandpass harmonics, and a relative-power mix, with an optional rate-of-change used in a coded next-bar rule.
- The series model has one user input named Fundamental, with a default period of 20 bars, that sets the primary cycle length.
- Filter coefficients are computed once from cosine terms at the fundamental period and at half and one-third of that period, using a fixed Bandwidth of 0.1.
- Each harmonic is isolated with a second-order bandpass filter on close prices, paired with a quadrature series, then mixed by relative in-phase and quadrature power when fundamental power is nonzero.
- An optional rate-of-change of the composite wave, scaled by the fundamental period divided by 12.57, is described as crossing zero at cyclic turning points and is the trigger in one coded next-bar market strategy.
A single fundamental period
The published Fourier analysis construction uses a single user input named Fundamental, with a default period of 20 bars, to set the primary cycle length for the series model. That Fundamental length is the dominant cycle detection setting used by every later stage.
Coefficients for three harmonics
Filter coefficients are computed once from cosine terms at the fundamental period and at half and one-third of that period, using a fixed Bandwidth of 0.1. Those three periods are the harmonics that the bandpass filter stages isolate.
Three-harmonic bandpass coefficients at a 20-bar fundamental

Computed once from Fundamental = 20 bars and Bandwidth = 0.1, then held fixed. Band-pass outputs are forced to zero for the first three bars and quadrature for the first four, so the composite wave is undefined at the start of a sample.
Bandpass isolation and a quadrature series
Each harmonic is isolated with a second-order bandpass filter on close prices. A quadrature series is then formed by scaling the first difference of that bandpass by the fundamental period divided by about 6.28.
Undefined history at the start
Bandpass outputs are forced to zero for the first three bars, and quadrature outputs are forced to zero for the first four bars, so the recursive filters do not start from undefined history.
Relative power and the composite wave
Relative harmonic amplitudes are estimated by summing in-phase and quadrature power over a lookback equal to the fundamental period. When fundamental power is nonzero, the composite wave equals the fundamental bandpass plus the second and third bandpasses scaled by the square roots of their power ratios to the fundamental.
An optional turning-point series
An optional rate-of-change of the composite wave, scaled by the fundamental period divided by 12.57, is described as crossing zero at cyclic turning points. One coded strategy buys the next bar at market when that rate-of-change crosses above zero and sells short the next bar at market when it crosses below zero.
All readings on this track · 9 readings
- 1994Constructing a cycle-aligned bandpass from paired lowpass filters
- 2008A bandpass filter bank for dominant cycle construction
- 2010Construct a bandpass, cycle, and trend mode detector
- 2015Constructing a one-parameter bandpass oscillator from two-bar momentum
- 2015Bandpass cycle models cannot promise certainty
- 2016Dual exponential Super Passband filter construction
- 2017A three-flag swing window with a bandpass midpoint
- 2019Building a three-harmonic Fourier series cycle wave
- 2019Lock a band, take a short lead, then gate empty readings