Step response of discrete-time filter System object
analyzes the filter System object based on the arithmetic specified in
arithType using any
one of the previous syntaxes.
Design an equiripple lowpass FIR filter and compute the step response of the filter.
fdesign.lowpass specification object to define the filter specifications. Run the
design function on the specification object to create a
dsp.FIRFilter object. Specify the passband frequency to be 20 kHz, stopband frequency to be 22.05 kHz, passband ripple to be 1 dB, and the stopband attenuation to be 80 dB. Specify the sampling frequency to be 96 kHz.
Fs = 96e3; filtSpecs = fdesign.lowpass(20e3,22.05e3,1,80,Fs); firlp2 = design(filtSpecs,'equiripple','SystemObject',true)
firlp2 = dsp.FIRFilter with properties: Structure: 'Direct form' NumeratorSource: 'Property' Numerator: [4.2157e-04 9.7407e-04 3.1143e-04 -0.0031 -0.0082 ... ] InitialConditions: 0 Show all properties
Compute the step response of the filter using the
sysobj— Input filter
Input filter, specified as one of the following filter System objects:
n— Length of step response vector
Length of the step response vector, specified as a positive integer.
fs— Sampling frequency
1(default) | positive scalar
Sampling frequency used in computing the step response, specified as a positive scalar.
arithType— Arithmetic type
Arithmetic used in the filter analysis, specified as
'Fixed'. When the arithmetic
input is not specified and the filter System object is unlocked, the analysis tool assumes a double-precision filter. When the
arithmetic input is not specified and the System object is locked, the function performs the analysis based on the data type of
the locked input.
'Fixed' value applies to filter System objects with fixed-point
'Arithmetic' input argument is specified as
'Fixed' and the filter object has the data type of the
coefficients set to
'Same word length as input', the arithmetic
analysis depends on whether the System object is unlocked or locked.
unlocked –– The analysis object function cannot determine the coefficients data type. The function assumes that the coefficients data type is signed, has a 16-bit word length, and is auto scaled. The function performs fixed-point analysis based on this assumption.
locked –– When the input data type is
'single', the analysis object function cannot
determine the coefficients data type. The function assumes that the data
type of the coefficients is signed, has a 16-bit word length, and is auto
scaled. The function performs fixed-point analysis based on this
To check if the System object is locked or unlocked, use the
When the arithmetic input is specified as
'Fixed' and the filter
object has the data type of the coefficients set to a custom numeric type, the object
function performs fixed-point analysis based on the custom numeric data type.
stepResp— Step response
Step response, returned as an
n-element vector. If
n is not specified, the length of the step response vector equals
the number of coefficients,
k in the filter.
t— Time vector
Time vector of length
n in seconds. The vector
t consists of
n equally spaced points in the
n is not specified,
the function uses the number of coefficients
k in the