Skip to content

Signal processing

How sampling, filters and frequency analysis transform financial time series, with a causal averaging example that exposes future-information leakage.

Signal processing is the analysis and transformation of observations indexed by time or another ordered coordinate. In quantitative finance, it helps turn prices, returns, order flow or volatility measurements into features with a defined sampling interval, response speed and information cutoff. A smoother series may be easier to model; that alone does not make it a profitable trading signal.
The word signal has two uses here. A signal-processing input is simply an observed sequence, including its unwanted variation. A trading signal is a feature intended to inform a position or forecast. Calling something a signal in the first sense establishes no predictive value in the second.

Start with the clock

Before choosing a filter, define what each observation means. A daily closing price, a daily return and the day's total volume are different objects. Resampling them requires different rules: the last price, a correctly compounded return or summed volume. Missing observations, trading breaks and stale quotes also change what “one step” means.

For equally spaced point observations, the sampling frequency determines which oscillations can be distinguished. Sampling once per time unit cannot distinguish the two synthetic cosines below: frequencies of 0.2 and 0.8 cycles per unit produce the same values at every integer time. This is aliasing, not evidence that the fast movement has become a slow economic cycle.
Synthetic cosines at 0.2 and 0.8 cycles per time unit agree at integer sampling times 0 through 5. Their periods are 5 and 1.25 units, so identical samples hide distinct continuous paths.
Synthetic cosines at 0.2 and 0.8 cycles per time unit agree at integer sampling times 0 through 5. Their periods are 5 and 1.25 units, so identical samples hide distinct continuous paths.
Original synthetic point-sampling example. The solid and dashed curves differ between observations, but all sampled markers coincide; neither curve represents market data.
The Nyquist–Shannon theorem guarantees ideal reconstruction under a band-limit condition: the original signal has no frequency content at or above half the sampling rate. It does not guarantee that daily market observations retain every intraday movement. Filtering before downsampling can limit aliasing; filtering afterwards cannot generally recover information already lost. Financial bars also aggregate over intervals, so the point-sampling diagram is a warning about lost information, not a complete model of bar construction. Berkeley's sampling theorem states the mathematical assumptions.
For the practical timestamp and aggregation groundwork, see Time-Series Data (public preview; full lesson requires membership).

A filter changes the sequence—and its timing

A filter maps an input sequence xtx_t to an output sequence yty_t. One simple causal filter is the trailing three-observation average:
yt=xt+xt−1+xt−23.y_t=\frac{x_t+x_{t-1}+x_{t-2}}{3}.

Here “causal” means that the output uses only current and past inputs. It does not mean that the feature identifies an economic cause. Assume xtx_t becomes available at the end of observation tt; then yty_t is available only after that input arrives.

Consider six fictional return observations, in decimal units:

(x0,x1,x2,x3,x4,x5)=(0,0,0.06,0,0,0).(x_0,x_1,x_2,x_3,x_4,x_5)=(0,0,0.06,0,0,0).

With zero prehistory, the trailing average is (0,0,0.02,0.02,0.02,0)(0,0,0.02,0.02,0.02,0). The isolated 6% return becomes three 2% average readings. Those readings are overlapping summaries of one event, not three newly observed positive returns.

Now replace the trailing filter with the centred average ct=(xt−1+xt+xt+1)/3c_t=(x_{t-1}+x_t+x_{t+1})/3. With zero padding outside this illustrative record, its output is (0,0.02,0.02,0.02,0,0)(0,0.02,0.02,0.02,0,0). At t=1t=1, it is already positive because it includes x2x_2. Using that value to decide a trade at t=1t=1 introduces look-ahead bias. It is a valid retrospective smoother, or a quantity that can be released one observation later, once xt+1x_{t+1} is known.
A synthetic 6 percentage-point return occurs only at observation 2. The trailing three-point average is 2 percentage points at observations 2, 3 and 4. The centred average is 2 at observations 1, 2 and 3, responding one observation before the input arrives.
A synthetic 6 percentage-point return occurs only at observation 2. The trailing three-point average is 2 percentage points at observations 2, 3 and 4. The centred average is 2 at observations 1, 2 and 3, responding one observation before the input arrives.
Original synthetic example with zero padding. Each row uses the same vertical scale. The boxed centred output at t = 1 requires the input at t = 2; connectors and stems do not imply continuous returns.
An impulse response records how a filter reacts to one isolated unit input. For this trailing average it is 1/31/3 at lags 0, 1 and 2, and zero elsewhere. Fixed linear, time-invariant filters combine shifted copies of that response through convolution. For such a filter, zero response at negative lags is the causality condition described in Oppenheim's MIT notes.

Frequency describes variation, not forecasting power

The time-domain question is “when does the filter react?” The frequency-domain question is “which rates of oscillation does it preserve, attenuate or shift?” A discrete Fourier transform represents a finite record using frequency components; a peak describes that record and need not persist in the future.

For the three-point average, the frequency response is

H(f)=1+e−2πif+e−4πif3,H(f)=\frac{1+e^{-2\pi i f}+e^{-4\pi i f}}{3},
where i2=−1i^2=-1 and ff is measured in cycles per observation. Its magnitude is the amplitude multiplier for a sinusoidal input, away from initialisation effects. A constant is preserved: H(0)=1H(0)=1. A period-three oscillation is cancelled: H(1/3)=0H(1/3)=0. An alternating sequence at f=1/2f=1/2 retains one-third of its amplitude. Averaging therefore has a low-pass character, but does not cleanly remove every fast component. Berkeley's running-average derivation explains this distinction.

“Noise” must be defined against the task. Fast changes can contain execution information; slow changes can be irrelevant drift. A smoother may suppress useful movement and delay a response. Its visual neatness cannot select the appropriate trading horizon.

Carry the information cutoff through the research

A trailing formula is only one part of an implementable feature. Its inputs must have been available at the decision time, and its window, scaling and other fitted settings must also have been chosen without access to the evaluation future. Choosing the best filter on the entire record can leak future information even when every individual average uses past lags.

Evaluate the full transformation and forecasting procedure at successive historical decision times, fitting on information then available and scoring later outcomes. This is the logic of time-series cross-validation. If the output drives trades, assess feasible execution and costs as well: statistical smoothing supplies no economic edge by itself. Forecast Evaluation develops the rolling evaluation design (public preview; full lesson requires membership).

Sources

Last updated
  • signal processing
  • time series
  • sampling
  • filtering
  • frequency analysis
  • look ahead bias
← Back to the glossaryBack to top ↑