What is Fast Fourier Transform?
Fast Fourier Transform (FFT) is a powerful mathematical algorithm that transforms time-domain data into the frequency domain. In simpler terms, it takes a complex signal (like stock price movements) and breaks it down into its constituent cycles or wavelengths.
Named after the French mathematician Jean-Baptiste Joseph Fourier, this technique has applications in various fields including image processing, audio analysis, and - as in our application - financial market analysis.
"The Fast Fourier Transform is the most important numerical algorithm of our lifetime."
— Gilbert Strang, Professor of Mathematics, MIT
How FFT Works in Market Analysis
When applied to stock market data, FFT helps uncover hidden patterns that might not be visible in the original price chart:
-
Time to Frequency Domain Conversion
FFT transforms price data from a time series (prices over time) into a frequency spectrum (cycles of different periods).
-
Cycle Identification
The resulting frequency spectrum reveals which cycle lengths are most prominent in the price data. Peaks in this spectrum represent dominant cycles.
-
Amplitude and Phase Information
For each cycle, FFT provides both amplitude (how strong the cycle is) and phase (where in the cycle we currently are) information.
-
Cycle Extraction
By filtering and focusing on specific frequency ranges, we can isolate and study individual cycles.
Mathematical Foundation
The discrete Fourier transform of a price signal is computed as:
Where x(n) is the price data, N is the number of data points, and k is the frequency index. The Fast Fourier Transform is an optimized algorithm to compute this transformation efficiently.
Advantages of FFT Analysis in Trading
Efficiency
FFT is computationally efficient, allowing for real-time analysis of large datasets.
Noise Reduction
Helps separate meaningful cycles from random market noise.
Hidden Pattern Detection
Reveals cyclical patterns that may be invisible in traditional price charts.
Quantitative Precision
Provides exact measurements of cycle lengths, strengths, and phases.
Power Spectrum Interpretation
One of the key outputs of FFT analysis is the power spectrum, which shows the strength (amplitude) of cycles at different periods:
X-Axis (Period)
The horizontal axis represents the cycle period in days (typically shown on a logarithmic scale).
Shorter periods (faster cycles) appear on the left, while longer periods (slower cycles) appear on the right.
Y-Axis (Amplitude)
The vertical axis shows the amplitude or strength of each cycle.
Taller peaks indicate stronger cycles that have more influence on price movement.
Interpreting Peaks
Peaks in the power spectrum represent dominant cycles in the price data. For example, a peak at 20 days suggests a cycle that completes approximately every 20 trading days.
Multiple peaks indicate that price is influenced by several cycles of different lengths simultaneously.