Main Content

removeBranch

Remove branch from parallel filter

Since R2023b

Description

removeBranch(PF) removes a branch from the end of the parallel filter PF.

removeBranch(PF,branchId) removes the branch from the branch position branchId of the parallel filter PF. All existing filter branches from branchId to the end of the filter shift up in the stack when you remove the branch.

example

Examples

collapse all

Use the removeBranch function to remove branches from a parallel filter.

Remove from End of Parallel Filter

Construct a dsp.ParallelFilter object with a dsp.FIRFilter object on the first branch, a dsp.IIRFilter object on the third branch, and a dsp.Delay object on the second and fourth branches.

pf = dsp.ParallelFilter(dsp.FIRFilter,dsp.Delay,dsp.IIRFilter,dsp.Delay)
pf = 
  dsp.ParallelFilter with properties:

          Branch1: [1x1 dsp.FIRFilter]
          Branch2: [1x1 dsp.Delay]
          Branch3: [1x1 dsp.IIRFilter]
          Branch4: [1x1 dsp.Delay]
    CloneBranches: true

Remove a branch from the end of the parallel filter.

removeBranch(pf);
pf
pf = 
  dsp.ParallelFilter with properties:

          Branch1: [1x1 dsp.FIRFilter]
          Branch2: [1x1 dsp.Delay]
          Branch3: [1x1 dsp.IIRFilter]
    CloneBranches: true

Remove from Specific Index

You can also specify the index from which to remove a branch.

Remove a filter from the second branch of the parallel filter. The dsp.IIRFilter object at index 3 shifts to index 2.

removeBranch(pf,2);
pf
pf = 
  dsp.ParallelFilter with properties:

          Branch1: [1x1 dsp.FIRFilter]
          Branch2: [1x1 dsp.IIRFilter]
    CloneBranches: true

Input Arguments

collapse all

Parallel filter, specified as a dsp.ParallelFilter System object.

Index of the filter branch to remove, specified as a positive integer. The function removes the filter branch from this location in the parallel filter. All existing filter branches from branchId to the end of the filter shift up in the stack when you remove the branch.

Version History

Introduced in R2023b