Simple Moving Average Explorer

Explore how window size affects signal smoothing. A larger window averages more samples, reducing noise but potentially obscuring rapid changes in the underlying signal.

Samples 10,000
Window 50
Variance (raw)
Variance (smoothed)
Reduction
Raw Signal
SMA (n)
SMA[i] = ( x[i] + x[i−1] + x[i−2] + … + x[i−n+1] ) / n

Small Window (n → 1)

A small window keeps the smoothed signal close to the original, preserving rapid changes and fine detail but doing little to suppress noise. At n = 1, the output is the raw signal itself.

Large Window (n → 10000)

A large window aggressively suppresses noise, revealing the broad trend, but introduces lag and may smooth away meaningful features. The first n − 1 points are zero-padded, pulling the average toward zero before a full window is available.