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.

removeStage

Remove stage from filter cascade

Syntax

removeStage(FC)
removeStage(FC,stageId)

Description

removeStage(FC) removes a stage from the dsp.FilterCascade object FC.

example

removeStage(FC,stageId) removes the stage from the stage position stageId of the filter cascade stored in the dsp.FilterCascade object 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 remove a filter stage from a filter cascade object.

When you call removeStage with no arguments other than the object, it removes the last stage in the cascade.

FC2= dsp.FilterCascade(dsp.FIRFilter,dsp.IIRFilter)
FC2 = 
  dsp.FilterCascade with properties:

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

removeStage(FC2);
FC2
FC2 = 
  dsp.FilterCascade with properties:

    Stage1: [1x1 dsp.FIRFilter]

To remove any stage of the cascade, specify an index argument. This example creates a filter cascade that has four stages, and then removes the third stage.

 FC4 = cascade(dsp.FIRInterpolator, dsp.FIRInterpolator, dsp.FIRDecimator, dsp.FIRDecimator)
FC4 = 
  dsp.FilterCascade with properties:

    Stage1: [1x1 dsp.FIRInterpolator]
    Stage2: [1x1 dsp.FIRInterpolator]
    Stage3: [1x1 dsp.FIRDecimator]
    Stage4: [1x1 dsp.FIRDecimator]

 removeStage(FC4,3);
 FC4
FC4 = 
  dsp.FilterCascade with properties:

    Stage1: [1x1 dsp.FIRInterpolator]
    Stage2: [1x1 dsp.FIRInterpolator]
    Stage3: [1x1 dsp.FIRDecimator]

Input Arguments

collapse all

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

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

Introduced in R2014b