This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

impz

Impulse response of discrete-time filter System object

Syntax

[impResp,t] = impz(sysobj)
[impResp,t] = impz(sysobj,n)
[impResp,t] = impz(sysobj,n,fs)
[impResp,t] = impz(sysobj,[],fs)
[impResp,t] = impz(sysobj,'Arithmetic',arithType)
impz(sysobj)

Description

example

[impResp,t] = impz(sysobj) computes the impulse response of the filter System object™, sysobj, and returns the response in column vector impResp, and a vector of times (or sample intervals) in t, where t = [0 1 2 ...k-1]'. k is the number of filter coefficients.

[impResp,t] = impz(sysobj,n) computes the impulse response at floor(n) 1-second intervals. The time vector t equals (0:floor(n)-1)'.

[impResp,t] = impz(sysobj,n,fs) computes the impulse response at floor(n) 1/fs-second intervals. The time vector t equals (0:floor(n)-1)'/fs.

[impResp,t] = impz(sysobj,[],fs) computes the impulse response at k 1/fs-second intervals. k is the number of filter coefficients. The time vector t equals (0:k-1)'/fs.

[impResp,t] = impz(sysobj,'Arithmetic',arithType) computes the impulse response based on the arithmetic specified in arithType, using either of the previous syntaxes.

impz(sysobj) uses fvtool to plot the impulse response of the filter System object sysobj.

You can use impz for both real and complex filters. When you omit the output arguments, impz plots only the real part of the impulse response.

For more input options, refer to impz.

Examples

collapse all

Create a discrete-time filter for a fourth-order, lowpass 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 impulse response, along with the reference impulse response.

d = fdesign.lowpass(.4,.5,1,80);

Create a design object for the prototype filter. Use ellip to design a minimum order discrete-time biquad filter.

biquad = design(d,'ellip','Systemobject',true);

Plot the impulse response.

impz(biquad);
axis([1 75 -0.2 0.35])

Input Arguments

collapse all

Length of the impulse response vector, specified as a positive integer.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Sampling frequency used in computing the impulse response, specified as a positive scalar.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Specify the arithmetic used during analysis. When you specify 'double' or 'single', the function performs double- or single-precision analysis. When you specify 'fixed' , the arithmetic changes depending on the setting of the CoefficientDataType property and whether the System object is locked or unlocked.

Details for Fixed-Point Arithmetic

System Object StateCoefficient Data TypeRule
Unlocked'Same as input'The function assumes that the coefficient data type is signed, 16 bit, and autoscaled. The function performs fixed-point analysis based on this assumption.
Unlocked'Custom'The function performs fixed-point analysis based on the setting of the CustomCoefficientsDataType property.
Locked'Same as input'When the input data type is 'double' or 'fixed', the function assumes that the coefficient data type is signed, 16-bit, and autoscaled. The function performs fixed-point analysis based on this assumption.
Locked'Custom'The function performs fixed-point analysis based on the setting of the CustomCoefficientsDataType property.

When you do not specify the arithmetic for non-CIC structures, the function uses double-precision arithmetic if the filter System object is in an unlocked state. If the System object is locked, the function performs analysis based on the locked input data type. CIC structures only support fixed-point arithmetic.

Output Arguments

collapse all

Impulse response, returned as an n-element vector. If n is not specified, the length of the impulse response vector equals the number of coefficients in the filter.

Data Types: double

Time vector of length n, in seconds. t consists of n equally spaced points in the range (0:floor(n)-1)'/fs. If n is not specified, the function uses the number of coefficients of the filter.

Data Types: double

Introduced in R2011a