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.

addStage

Add new filter stage to cascade

Syntax

addStage(FC,newFilt)
addStage(FC,newFilt,stageId)

Description

example

addStage(FC,newFilt) adds the newFilt System object™ as the final stage of the filter cascade stored in the dsp.FilterCascade object FC. To see which System objects you can add to a filter cascade, use:

dsp.FilterCascade.helpSupportedSystemObjects

example

addStage(FC,newFilt,stageId) adds newFilt at stage position stageId of the filter cascade FC. All existing filters from stageId to end of the cascade are shifted up in the cascade.

Examples

collapse all

This example shows how to add a filter stage to a filter cascade.

When you call addStage with only the object arguments, the object adds the new filter stage as the final stage in the cascade.

FC = dsp.FilterCascade 
FC = 
  dsp.FilterCascade with properties:

    Stage1: [1x1 dsp.FIRFilter]

addStage(FC,dsp.IIRFilter)
FC
FC = 
  dsp.FilterCascade with properties:

    Stage1: [1x1 dsp.FIRFilter]
    Stage2: [1x1 dsp.IIRFilter]

When you call addStage with an index argument, the object adds the new filter stage at the index you specified. This example creates a filter cascade with three stages, and then adds a filter as the second stage of the cascade.

FC = dsp.FilterCascade(dsp.CICDecimator,dsp.FIRDecimator,dsp.FIRFilter)
FC = 
  dsp.FilterCascade with properties:

    Stage1: [1x1 dsp.CICDecimator]
    Stage2: [1x1 dsp.FIRDecimator]
    Stage3: [1x1 dsp.FIRFilter]

addStage(FC,dsp.IIRFilter, 2)
FC
FC = 
  dsp.FilterCascade with properties:

    Stage1: [1x1 dsp.CICDecimator]
    Stage2: [1x1 dsp.IIRFilter]
    Stage3: [1x1 dsp.FIRDecimator]
    Stage4: [1x1 dsp.FIRFilter]

Input Arguments

collapse all

Filter cascade, specified as a dsp.FilterCascade System object.

Filter stage to add, specified as one of the supported System objects or a scalar gain value. Each stage can be a filter or delay object, or a scalar gain value. To see which System objects you can add to a filter cascade, use:

dsp.FilterCascade.helpSupportedSystemObjects

Index of filter stage to be removed, specified as a positive integer. The object removes this stage from the filter cascade.

Introduced in R2014b