Filter Design Toolbox    
impz

Compute the impulse response of quantized filters

Syntax

Description

[h,t] = impz(hq) computes the response of the quantized filter hq to an impulse. impz returns the computed impulse response in the column vector h and the corresponding sample times in the column vector t (where t = [0:n-1]' and n = length(t) is computed automatically).

[h,t] = impz(hq,n) computes n samples of the quantized impulse response for any positive integer n. In this case, t = [0:n-1]'. When 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 [] as the second argument, impz computes the number of samples automatically.

[h,t] = impz(hq,n,Fs) computes n samples and produces a vector t of length n so that the samples are spaced 1/Fs units apart.

[h,t,ref] = impz(hq,...) returns the impulse response of the quantized filter hq in the column vector h, and returns the impulse response of the reference filter in the vector ref.

impz(hq,...) with no output arguments plots the impulse response of the reference filter associated with hq, and the quantized impulse response of quantized filter hq in a new figure window. impz uses stem for plotting the impulse responses.

Examples

Create a quantized filter for a fourth-order, low-pass elliptic filter with a cutoff frequency of 0.4 times the Nyquist frequency. Use a second-order sections structure to resist quantization errors. Plot the first 50 samples of the quantized impulse response, along with the reference impulse response.

Algorithm

impz applied to the quantized filter hq applies the filter command twice to a length n impulse sequence:

The resulting plots use stem.

Warnings that occur with impz are a result of the filter command. In particular, you get an input overflow warning with impz when the InputFormat property value for the quantized filter hq is fixed-point and has only one bit to the left of the radix point.

For example, when your InputFormat property is set to {'fixed',[16,15]}, you get an input overflow warning when you implement impz.

See Also
filter


  iirshiftc initkalman