Frequency response describes how a system — such as a filter, amplifier, or sensor — modifies the amplitude and phase of sinusoidal input signals as a function of frequency. It is the complete characterization of a linear time-invariant (LTI) system in the frequency domain, capturing both magnitude response (gain vs. frequency) and phase response (phase shift vs. frequency).
In practice
In embedded signal processing, frequency response is the primary tool for specifying and evaluating filters. A low-pass FIR or IIR filter designed for anti-aliasing, sensor smoothing, or audio processing is typically specified by its passband gain, stopband attenuation, and transition band width — all features of its magnitude response. Phase response matters when signal shape must be preserved across frequency; a linear-phase FIR filter delays all frequencies equally, while many IIR designs (Butterworth, Chebyshev) introduce phase distortion that can be problematic for time-domain waveform fidelity.
On resource-constrained MCUs, frequency response analysis informs the tradeoff between filter order and computational cost. A higher-order filter achieves a steeper roll-off but demands more multiply-accumulate operations per sample. On Cortex-M4/M7 cores with a hardware FPU and SIMD instructions, higher-order FIR filters are more practical than on an 8-bit PIC or AVR running the same sample rate. The blog post "FIR Filter to Match Any Magnitude and Phase Response" discusses designing FIR filters to approximate an arbitrary target response, a technique used when standard window or Parks-McClellan designs do not meet a specific spectral shape requirement.
The Discrete Fourier Transform (DFT) provides a practical route to measuring or visualizing frequency response on a discrete-time system. By injecting a known signal (or using the impulse response) and computing the DFT of the output, a developer can plot the actual magnitude response of a running system, including effects of fixed-point quantization and coefficient rounding. The blog post "The Discrete Fourier Transform as a Frequency Response" covers this connection directly. Frequency notation across different texts and tools can be a source of confusion; the blog post "A Table of Digital Frequency Notation" is a useful reference for keeping normalized frequency, radians/sample, Hz, and cycles/sample straight when comparing responses between design tools and implementation.
Discussed on DSPRelated
Frequently asked
What is the difference between frequency response and magnitude response?
Frequency response is the full complex-valued function H(f) or H(e^jω), encoding both magnitude and
phase at every frequency. Magnitude response |H(f)| is just the amplitude part — how much gain or attenuation the system applies at each frequency. The two terms are sometimes used interchangeably in casual usage, but they are not identical; discarding phase information loses the timing relationships between frequency components.
How do I measure the frequency response of a filter running on my MCU?
A common approach is to feed the filter its
impulse response (a single sample of value 1 followed by zeros) and capture the output. The
DFT of that output sequence is the filter's frequency response. Alternatively, a swept sine or a broadband noise source can be used for in-circuit measurement of the full signal chain, including analog front-end effects. Fixed-point implementations may show a response that deviates from the ideal
floating-point design due to coefficient quantization, so measuring on the actual hardware is more reliable than relying solely on design-tool plots.
Why does phase response matter in embedded filter design?
Phase response determines how the filter delays different frequency components relative to each other. If all frequencies are delayed equally (
linear phase), the output waveform is a time-shifted replica of the input with no shape distortion — important in applications like ECG processing, audio, or radar pulse shaping. Non-linear phase, common in
IIR designs, warps the waveform shape. In control loops, phase shift also affects stability margins, so the phase response of any filter in the feedback path must be accounted for in the loop analysis.
What is the relationship between the unit circle and frequency response for a digital filter?
For a discrete-time LTI filter with
z-transform H(z), the frequency response is obtained by evaluating H(z) on the unit circle in the z-plane — that is, at z = e^jω for ω ranging from 0 to 2π. Poles near the unit circle produce peaks in the magnitude response; zeros on the unit circle produce nulls. Visualizing the pole-zero plot alongside the unit circle gives an intuitive geometric picture of the filter's spectral shape, a technique explored in the blog post 'There's No End to It -- Matlab Code Plots Frequency Response above the Unit Circle'.
How does sampling rate affect the frequency response I can achieve?
The
Nyquist limit constrains the usable frequency range to 0 –
Fs/2. The frequency response of a digital filter is periodic with period Fs, so all spectral features fold into that
baseband range. A higher sample rate gives more room to place the transition band of an anti-
aliasing or reconstruction filter, which can relax the filter order required to meet a given stopband specification. On embedded targets where sample rate and CPU budget are both constrained, this tradeoff is often a key design decision.
Differentiators vs similar concepts
Frequency response (the full complex H(f), capturing both magnitude and
phase) is often conflated with magnitude response (|H(f)| only). The distinction matters whenever phase shift affects system behavior — for example, in linear-phase filter design or in control-loop stability analysis. Frequency response is also distinct from the
transfer function: the transfer function H(s) or H(z) is the general algebraic expression defined across the entire complex plane, while frequency response is specifically its evaluation on the imaginary axis (s-domain) or unit circle (z-domain), i.e., the steady-state sinusoidal behavior.