Linear Filter and Frequency Response
A linear time-invariant filter transforms an input series into an output series by a fixed weighted combination of past, present, and possibly future values:
The coefficients are the filter weights (also called the impulse response: they are exactly what comes out when the input is a unit impulse ). The filter is causal if for all , meaning the output depends only on present and past inputs and can be implemented online; non-causal filters require the entire input record before producing output and so are restricted to offline analysis.The frequency response is the discrete-time Fourier transform of the weights:
Its magnitude is the gain at frequency (how much each frequency is amplified or attenuated by the filter), and its argument is the phase shift (how much that frequency component is delayed in time).The central spectral identity is that filtering a stationary input scales its spectrum by the squared gain:
This converts the time-domain operation into a frequency-domain product, which is far easier to work with both analytically and computationally.Convolution-Multiplication Duality convolution in the time domain becomes multiplication in the frequency domain. The DTFT of equals , and applying expectations to a stationary process gives the spectral identity . Designing a filter to amplify or suppress a specific frequency band is therefore done in the frequency domain (decide what should look like) and inverse-transformed to recover the weights that implement it.
The whole reason linear filters are tractable is that
Intuition
A linear filter is a recipe for re-weighting a time series: smoothing, sharpening, delaying, or differencing. Once the recipe is described in the frequency domain (“keep frequencies below , kill frequencies above ”), its action on any input is just point-wise multiplication of spectra. Convolution is unwieldy because every output value depends on a window of input values; multiplication is trivial because each frequency is handled independently. This duality is what makes spectral analysis the natural language for any system whose response is linear and time-invariant: amplifiers, electrical circuits, audio processing, the cochlea, and most signal-processing pipelines.
The spectral identity has the same shape as the variance rule for scalar random variables, . The filter’s gain plays the role of , and squaring is the price of dropping phase information when going from amplitudes to power. Once the spectrum is recognized as a frequency-by-frequency variance, the two are visibly the same identity.
Properties
(Convolution-Multiplication) The DTFT of a convolution is the product of the DTFTs.
The identity , applied to expectations over a stationary process, yields the spectral identity . It also explains why FFT-based convolution beats direct convolution for long filters: an time-domain operation becomes an frequency-domain product plus two FFTs, with the crossover happening at filter lengths around in typical libraries.
(Cascade) Two filters in series have combined frequency response equal to the product of the individual responses.
If filter is followed by filter , the cascade has frequency response and the output spectrum is . Cascading is how complex filters are built from simple primitives: pre-emphasis, equalization, decimation pipelines all use this composition rule.
(Causality and Stability) Stability requires the weights to be absolutely summable; causality requires no negative-index weights.
A filter with is stable (bounded inputs produce bounded outputs); a filter with for is causal. Stability is required for the frequency response to even be defined as a convergent sum. Causality is required for online application. Many useful filters (zero-phase, ideal low-pass) are non-causal in their natural form and must be approximated causally for real-time use.
(Differencing as a Filter) The difference operator is a high-pass filter with zero gain at zero frequency.
The difference operator has weights and frequency response , giving
The gain is zero at (kills constant trends) and reaches its maximum of at (amplifies the highest frequencies). This is why differencing a signal with a linear trend produces a stationary residual, but also why over-differencing inflates high-frequency noise, a fact that matters for ARIMA modeling.
(Moving Average as Low-Pass) The simple moving average smooths by averaging over a window.
For weights for , the frequency response works out to
peaking at and zero at for . Increasing narrows the pass-band around (more aggressive smoothing) but also slows the filter’s response to changes in the underlying signal. The phase factor encodes a delay of samples, the cost of asymmetric averaging over only past observations.
(Zero-Phase Filtering) Applying a filter forward and then backward eliminates phase distortion.
Running a filter once forward and once in reverse (filtfilt in scipy) yields a zero-phase response with squared gain . This eliminates the phase distortion of asymmetric filters at the cost of doubling the gain shape and making the operation strictly non-causal. Standard practice for offline cleaning (EEG, audio post-production, climate data) where exact temporal alignment matters more than real-time operation.
Examples
First-difference of an AR(1) process
For with , what is the spectrum of ?
Solution . The differencing filter has . Multiplying these gives At , , since differencing kills the constant component that the AR(1) builds up at low frequency. At , , larger than , so high-frequency noise is amplified four-fold. The output spectrum is bowl-shaped: low frequencies suppressed, high frequencies enhanced.
The AR(1) spectrum is
Filtering away a 60Hz line-noise component
An EEG signal sampled at Hz contains a strong Hz line-noise contamination. Sketch a notch filter that passes everything else and predict the output spectrum.
Solution . A notch filter with frequency response approximately for small bandwidth kills the spike. The output spectrum is , identical to except for a thin trough at that removes the line noise. The corresponding filter weights come from the inverse DFT of and have many non-zero entries (sharp frequency responses require long filters), but the design lives entirely in the frequency domain.
In normalized units the offending frequency is