Inspect digital filter response with freqz
freqz(b, a) calculates the frequency response of a digital filter described by numerator coefficients b and denominator coefficients a. The response is complex, showing how gain and phase change across frequency.
Using the result
Use abs for gain magnitude and arg for phase. A low-pass filter should preserve low-frequency magnitude and attenuate high-frequency magnitude. For an actual sampled signal transform, use fft instead.
Coefficient and stability caveats
Coefficients must describe the intended transfer function, and an unstable denominator can produce extreme or undefined responses. Frequency units depend on sampling rate; normalized frequency must be converted before interpreting hertz. Use pow or other calculations to form coefficients carefully, and validate a design with representative inputs.