dfilt.scalar - Discrete-time, scalar filter

Syntax

Hd = dfilt.scalar(g)
Hd = dfilt.scalar

Description

Hd = dfilt.scalar(g) returns a discrete-time, scalar filter, Hd, with gain g, where g is a scalar.

Hd = dfilt.scalar returns a default, discrete-time scalar gain filter, Hd, with gain 1.

Example

Create a direct-form I filter and a scalar object with a gain of 3 and cascade them together.

b = [0.3 0.6 0.3];
a = [1 0 0.2];
Hd_filt = dfilt.df1(b,a)
Hd_gain = dfilt.scalar(3)
Hd=cascade(Hd_gain,Hd_filt)
fvtool(Hd_filt,Hd_gain,Hd)
Hd_filt =  
         FilterStructure: 'Direct-Form I'
               Numerator: [0.3000 0.6000 0.3000]
             Denominator: [1 0 0.2000]
        PersistentMemory: false

Hd_gain = 
         FilterStructure: 'Scalar'
                    Gain: 3
        PersistentMemory: false

Hd = 
         FilterStructure: Cascade
                Stage(1): Scalar
                Stage(2): Direct-Form I
        PersistentMemory: false

To view the stages of the cascaded filter, use

Hd.stage(1)
 
ans = 
         FilterStructure: 'Scalar'
                    Gain: 3
        PersistentMemory: false

and

Hd.stage(2)
 
ans = 
         FilterStructure: 'Direct-Form I'
               Numerator: [0.3 0.6 0.3]
             Denominator: [1 0 0.2]
        PersistentMemory: false

See Also

dfilt, dfilt.cascade

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS