Signal Processing Toolbox Previous page   Next Page
stepz

Step response of digital filters

Syntax

Description

[h,t] = stepz(b,a) computes the step response of the filter with numerator coefficients b and denominator coefficients a. stepz 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] = stepz(b,a,n) computes the first n samples of the step response when n is an integer (t = [0:n-1]'). I

[h,t] = stepz(b,a,n,fs) computes n samples and produces a vector t of length n so that the samples are spaced 1/fs units apart. fs is assumed to be in Hz.

stepz(b,a) with no output arguments plots the step response in the current figure window.

stepz(Hd) plots the step 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.

stepz works for both real and complex input systems.

Examples

Example 1

Plot the step response of a Butterworth filter:

The same example using a dfilt object and displaying the result in the Filter Visualization Tool (fvtool) is

Example 2

Plot the first 50 samples of the step 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 Visualization Tool (fvtool) is

Algorithm

stepz filters a length n step sequence using

and plots the results using stem.

To compute n in the auto-length case, stepz 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), stepz 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.

stepz also allows for delays in the numerator polynomial. The number of delays is incorporated into the computation for the number of samples.

See Also

freqz, grpdelay, impz, phasez, zplane


Previous page  ss2zp stmcb Next page

© 1994-2005 The MathWorks, Inc.