2020issue C068-15
Constructing a cosine-correlation cycle and phasor trend filter
A cycle-mode series is built by correlating ordered prices with a cosine over one full wavelength of a chosen period. The detector is first proved on a known sinusoid, period mismatch is measured as a bounded phase tilt, and a stalled phasor is reused as a Trend filter when the cycle-mode companion fails.
- Correlating ordered prices with a cosine wave over one full wavelength of a chosen period produces a cycle-mode series that stays in phase with a matching cyclic component.
- With the cosine held at 20 bars, stretching a known sinusoid to 30 bars or compressing it to 15 bars keeps phase error under 45 degrees, so the construction does not collapse when Dominant cycle detection is wrong.
- A negative-sine companion places a 90-degree lead, and phase is recovered as the arctangent of the cosine-correlation component over the sine-correlation component, with quadrant correction and a wrap from -180 to +180 degrees.
- When the sine-based rate series fails in a trend, that breakdown is reused to classify trend mode, and a companion Trend filter correlates prices with a straight line of positive slope.
Building the cosine-correlation series
A cycle-mode series can be built by correlating ordered prices with a cosine wave over one full wavelength of a chosen period. The output stays in phase with a matching cyclic component.
Editorial interpretation: the chosen cosine period is the Dominant cycle detection assumption, and the cosine and sine correlations are the Spectral analysis construction being proved on the bench.
Proving the detector on a known waveform
On a known 20-bar sinusoid, correlation with a 20-bar cosine overlays the input so tightly that detuning the input to 21 bars is used to show the two series are distinct.
With the cosine period held at 20 bars, stretching the input to 30 bars produces a leading phase error under 45 degrees. Compressing the input to 15 bars produces a lagging phase error under 45 degrees. The construction does not collapse when the assumed dominant cycle is wrong.
An orthogonal companion and a line Trend filter
An orthogonal companion series is formed by correlating the same input with a negative sine of that period. That companion places a 90-degree lead, so its zero crossings mark the peaks and valleys of the cosine-correlation output.
A companion Trend filter is constructed by correlating prices with a straight line of positive slope. That line correlation is intended for trend-mode conditions, just as the cosine correlation is intended for cyclic, mean-reverting conditions.
Using the correlations on real prices
On real prices the synthetic input period can be set to zero so the correlations use the price series itself. A 14-bar cosine period was chosen to bias the output toward a leading phase error.
Recovering phase from the two components
Phase is recovered as the arctangent of the cosine-correlation component over the sine-correlation component, with quadrant correction, a wrap from -180 to +180 degrees, and a constraint that the angle is not allowed to step backward.
Reusing a stalled phasor as market state
The sine-based rate series fails when price enters a trend. That cycle-mode breakdown is reused as a rapid way to classify the market as having switched into trend mode.
A market-state variable is 0 while phase keeps rotating, +1 when the angle freezes at or above zero, and -1 when it freezes below zero. Phase rates under 9 degrees per bar, equivalent to a 40-bar or longer dominant cycle, are classified as trend rather than cycle.
Because the phasor is assembled from two independent orthogonal inputs, the construction is described as having a 6 dB signal-to-noise advantage over a single conventional line indicator.
All readings on this track · 21 readings
- 1982Spectrum-first construction of moving-average trend filters
- 1990Crowd questions that switch cycle regimes
- 1993Antithetic twins to cancel origin-linked forecast bias
- 1994Constructing frequency response from a three-stage filter cascade
- 1994Bench-testing smoothers with cycle phase and power
- 1995Constructing minimum tradable cycles from spectral noise
- 1995Spectral whipsaw limits for a price-crossing average
- 1996Constructing market phase from dominant-cycle components
- 2000Constructing a Hilbert squelch dominant-cycle gate
- 2007When cycle mode fails: regime gates for spectral trades
- 2008Constructing singular-spectrum forecast baselines
- 2008Stacking a midband cycle gate on a short-memory trend filter
- 2011Engineering spectral cycle detection and moving-average harmony
- 2011Evaluating fixed oscillators against a moving dominant cycle
- 2011A construction checklist for a dominant-cycle sinewave
- 2012Assembling a market-mode heatmap from successive band-pass filters
- 2012Adaptive trend detection from dominant-cycle spectra
- 2015Constructing price paths from cycles and support
- 2018Oscillator distribution shape for mean-reversion filters
- 2020Constructing a cosine-correlation cycle and phasor trend filter
- 2020Constructing a correlation-cycle market-state engine