Signal Processing Toolbox |
Syntax
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(2) ans = FilterStructure: 'Direct-Form I' Numerator: [1x3 double] Denominator: [1 0 0.2000] PersistentMemory: false
See Also
dfilt.parallel | dfilt.statespace |
© 1994-2005 The MathWorks, Inc.