freqz

freqz(b, a)

freqz(b, a, w)

Try it yourself:


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.

Try Freqz in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions