dsp.FilterCascade
Create cascade of filter System objects
Description
The dsp.FilterCascade object creates a multistage
System object™ that enables cascading of filter System objects and scalar gains. This object
operates similar to the cascade function. However, the
cascade function does not support delay as a filter stage.
You can pass the dsp.FilterCascade
System object as a stage to another dsp.FilterCascade
System object. You can also pass dsp.FilterCascade
System object as an input to the cascade function.
When you call the object, the size, data type, and complexity of the input signal must be supported by all of the stages in the filter cascade. This object supports variable-size signals if the filter stages within the object support variable-size signals.
To filter a signal with a cascade of filters:
Create the
dsp.FilterCascadeobject and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Alternatively, you can generate a MATLAB® function from the filter cascade object, and call that function to filter a
signal. The generated function supports C/C++ code generation. For more details, see the
generateFilteringCode function.
Creation
Syntax
Description
returns a System object, FC = dsp.FilterCascadeFC that has a single stage, a dsp.FIRFilter
System object with default properties.
returns a multistage System object, FC = dsp.FilterCascade(filt1,filt2,...,filtn)FC, with the first stage set to
filt1, the second stage set to filt2, and so on.
Each stage can be a filter System object or a scalar gain value.
For example, create a filter cascade that includes a lowpass filter, a highpass filter, and a gain stage.
lpFilt = dsp.LowpassFilter(StopbandFrequency=15000,... PassbandFrequency=12000); hpFilt = dsp.HighpassFilter(StopbandFrequency=5000,... PassbandFrequency=8000); gain = 2; bpFilt = dsp.FilterCascade(lpFilt,hpFilt,2);
specifies the input sample rate as one of these:FC = dsp.FilterCascade(___,InputSampleRate=Value)
Positive real scalar — The input sample rate of the filter cascade is a positive real scalar.
"normalized"— The input sample rate of the filter cascade is in normalized frequency units regardless of the input sample rate of the individual filter stages."auto"— The input sample rate of the filter cascade is determined from the input sample rate of the individual filter stages as per these conditions:If all the filter stages have a normalized frequency, then the filter cascade has a normalized frequency.
If at least one filter stage has an absolute sample rate, then the filter cascade uses an absolute sample rate. The object determines this rate based on the rate conversion ratio of the stages within. For an example, see Specify Input Sample Rate in dsp.FilterCascade Object.
(since R2026a)
Properties
Usage
Syntax
Description
filters input
signal y = FC(x)x by using the filter cascade defined in
FC and returns filtered output y. The size,
data type, and complexity of the input signal must be supported by all of the stages in
the filter cascade. This object supports variable-size signals if the filter stages within
the object support variable-size signals.
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj, use
this syntax:
release(obj)



