Skip to main content
Track Fast Fourier Transform
6 / 16
Library

1994issue C041-6

Preprocessing prices so Fourier peaks set moving-average lengths

Everyday transforms rewrite a price series so a chosen feature is easier to inspect than the raw series. The same rewrite is applied before a fast Fourier transform: detrend the closes, force the ends to zero, pad to a power-of-two length, read the spectral peaks as cycle lengths, and take half of each length as a moving-average cutoff.

  • Preprocessing rewrites ordered prices so a later quantitative tool can read the intended feature more cleanly than the raw series.
  • A fast Fourier transform measures cyclical components in a finished, prepared sample; those cycles are not assumed to persist as a trading rule.
  • A Hanning taper and zero-padding give the residual series matching end levels and a power-of-two length.
  • Each readable spectral peak is converted into a day-count cycle, then halved to set a moving-average cutoff.
Entries in this reading3 entries

Why the raw series is rewritten

Everyday technical transforms such as a moving average or an oscillator rewrite a price series so a chosen feature is easier to inspect than the raw series. The chosen feature may be trend after smoothing, or extremes after trend removal.

Preprocessing is a mathematical rewrite of ordered price observations so a later quantitative tool can read the intended feature more cleanly than the raw series. A method borrowed from another field can need its inputs rescaled or otherwise adjusted. One case is a network that works best on values between +1 and -1, a range raw prices do not occupy.

Measure cycles after the window is prepared

A fast Fourier transform is applied after preprocessing to measure cyclical components. The transform converts an equally spaced, length-corrected series into a power spectrum of frequencies present in that window. Cycles found in a finished sample are not assumed to persist, so the transform is used to help design indicators and choose parameters rather than as a direct trading rule.

Detrend, then force the ends to zero

The first FFT preparation step shown is to subtract a linear least-squares fit from daily closes. That detrending leaves residual swings for the spectrum to measure instead of the drift. The residual series looks more cyclical, but its first and last values are not zero.

The transform as used here expects matching start and end levels and a length that is a power of two. A Hanning window, a cosine-shaped taper, drives the ends toward zero so the transform is not fed a step at the boundaries. Zeros are then appended to reach 256 points. A zero adds no cycle content, so zero-padding changes the length without adding cyclical components.

Convert peaks into average lengths

In the December 1993 copper window, the strongest spectral peak is 3.9375 cycles per year, which 252 trading days convert to a 64-day cycle. That bin is the dominant cycle: the frequency with the largest power in the prepared sample, expressed as a day-count lookback. The next peak at 19.6875 cycles per year converts to 12.80 days.

A moving-average cutoff is taken as half a measured cycle. A 32-period average is used to reject swings shorter than 64 days, and a six-period average is used to reject swings shorter than 12 days, matching those two spectral peaks. The moving average is the smoother whose length is set from the measured cycle so fluctuations shorter than that cutoff are attenuated.

The copper sample is limited to a single downtrend segment from 8 July 1993 through 18 November 1993 because a major reversal inside the window can distort the transform.

FFT spectrum of windowed December 1993 copper

The strongest coefficients sit near the 51-bar and 64-bar bins, so those cycle lengths — halved — are the moving-average cutoffs the method actually uses. Bar heights were read from the printed CF spectrum, not from a table; the category labels are the FFT bin periods shown on the chart.
The strongest coefficients sit near the 51-bar and 64-bar bins, so those cycle lengths — halved — are the moving-average cutoffs the method actually uses. Bar heights were read from the printed CF spectrum, not from a table; the category labels are the FFT bin periods shown on the chart.December 1993 copper futures · Daily · 1993-07-08T00:00:00.000Z to 1993-11-09T00:00:00.000Z

Hartle treats these historical peaks as a way to size averages, not as a live cycle forecast. Heights are approximate readings from the magazine bar chart, rounded to the nearest thousand on the printed 0–40000 CF scale. Periods match a 256-point transform (256/n).

Educational research material, not investment advice. Historical source context does not establish present-day performance.
6 of 16 in the Fast Fourier Transform track
19941-3 pp.Next on Fast Fourier TransformConstructing a spreadsheet FFT power spectrum from daily pricesDaily closes were converted to residuals by subtracting a linear least-squares trend before any window was applied.
All readings on this track · 16 readings
  1. 1982Building FFT spectra to size cycle filters
  2. 1988Fourier cycle models break in major swings
  3. 1988Constructing moving average filters from price Fast Fourier Transforms
  4. 1989Staging Fast Fourier construction under memory limits
  5. 1993Constructing forecast inputs with moving averages, Fourier transforms and intermarket spreads
  6. 1994Preprocessing prices so Fourier peaks set moving-average lengths
  7. 1994Constructing a spreadsheet FFT power spectrum from daily prices
  8. 1994Building dominant-cycle spectra with FFT preprocessing
  9. 1994Constructing labeled cycle lengths from FFT spectra
  10. 1999Fast Fourier Transform reconstruction is not a walk-forward decision tool
  11. 1999Walk-forward endpoint Fourier construction as a same-day mechanical procedure
  12. 2002From the power spectrum to indicator windows
  13. 2003Endpoint Fast Fourier Transform evaluation with walk-forward mechanical rules
  14. 2004Constructing signal and noise from market waveforms
  15. 2012A two-stage case study in market cycle analysis
  16. 2015Whitening pink noise to build a near-zero-lag cycle oscillator
All 17 readings tagged Fast Fourier Transform
Also on Fast Fourier Transform5 readings