# impz

Compute the impulse response of a digital filter.

## Syntax

[x,t] = impz(b,a)

[x,t] = impz(b,a,n)

[x,t] = impz(b,a,n,fs)

[x,t] = impz(b,a,[],fs)

impz(...)

## Inputs

b
The numerator polynomial coefficients of the filter.
Type: double
Dimension: vector
a
The denominator polynomial coefficients of the filter.
Type: double
Dimension: vector
n
The number of response samples to produce. Omit or use [] to allow the function to determine an appropriate number.
Type: integer
Dimension: scalar
fs
The sampling frequency (in Hz).
Type: double
Dimension: scalar

## Outputs

x
The impulse response.
Type: double
Dimension: vector
t
The time vector for the response.
Type: double
Dimension: vector

## Example

Verify the impulse response of a fourth order Butterworth low pass digital filter with a 300 Hz cutoff frequency and a 2000 Hz sampling frequency.

[b,a] = butter(4, 300/(2000/2));
impz(b,a,300,2000);

If the output arguments are omitted, the function will plot the results.

When defaulted, n will be chosen so that an attenuation of at least 120 dB is displayed for a stable filter, and amplification of at least 120 dB for an unstable filter, or at least five cycles for a marginally stable filter.