Signal Processing Toolbox |
Impulse response of digital filters
Syntax
Description
[h,t]
computes the impulse response of the filter with numerator coefficients =
impz(b,a)
b
and denominator coefficients a
. impz
chooses the number of samples and returns the response in the column vector h
and sample times in the column vector t
(where t = [0:n-1]'
, and n
= length(t)
is computed automatically).
[h,t]
computes n samples of the impulse response when n is an integer ( =
impz(b,a,n)
t
= [0:n-1]'
). If n is a vector of integers, impz computes the impulse response at those integer locations, starting the response computation from 0 (and t
= n
or t
= [0 n]
). If, instead of n
, you include the empty vector []
for the second argument, the number of samples is computed automatically by default.
[h,t]
computes n samples and produces a vector =
impz(b,a,n,fs)
t
of length n
so that the samples are spaced 1/fs
units apart.
impz(b,a)
with no output arguments plots the impulse response and displays the response in the current figure window.
impz(Hd)
plots the impulse responsee of the filter and displays the plot in fvtool
. The input Hd
is a dfilt
filter object or an array of dfilt
filter objects.
Examples
Plot the first 50 samples of the impulse response of a fourth-order lowpass elliptic filter with cutoff frequency of 0.4 times the Nyquist frequency:
The same example using a dfilt
object and displaying the result in the Filter Tool (fvtool
) is
Algorithm
impz
filters a length n
impulse sequence using
and plots the results using stem
.
To compute n
in the auto-length case, impz
either uses n = length(b)
for the FIR case or first finds the poles using p = roots(a)
, if length(a)
is greater than 1.
If the filter is unstable, n
is chosen to be the point at which the term from the largest pole reaches 10^6
times its original value.
If the filter is stable, n
is chosen to be the point at which the term due to the largest amplitude pole is 5
*10^-5
of its original amplitude.
If the filter is oscillatory (poles on the unit circle only), impz
computes five periods of the slowest oscillation.
If the filter has both oscillatory and damped terms, n
is chosen to equal five periods of the slowest oscillation or the point at which the term due to the largest (nonunity) amplitude pole is 5
*10^-5
of its original amplitude, whichever is greater.
impz
also allows for delays in the numerator polynomial. The number of delays is incorporated into the computation for the number of samples.
See Also
impinvar | interp |
© 1994-2005 The MathWorks, Inc.