# freqz() Function & Examples

Use the freqz() signal function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## freqz

#### freqz(b, a)

#### freqz(b, a, w)

Try it yourself:

```calculio
freqz([1, 2], [1, 2, 3])
freqz([1, 2], [1, 2, 3], [0, 1])
freqz([1, 2], [1, 2, 3], 512)
```

---

## 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](https://calcul.io/function/abs/index.md) for gain magnitude and [arg](https://calcul.io/function/arg/index.md) for phase. A low-pass filter should preserve low-frequency magnitude and attenuate high-frequency magnitude. For an actual sampled signal transform, use [fft](https://calcul.io/function/fft/index.md) 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](https://calcul.io/function/pow/index.md) or other calculations to form coefficients carefully, and validate a design with representative inputs.

[All functions](https://calcul.io/functions/index.md)
