Check scaling of biquadratic filter
This example shows how to check the Linf-norm scaling of a filter.
Design an elliptic sos filter in the direct form II structure with default specifications.
EllipII = design(fdesign.lowpass, 'ellip', 'FilterStructure', 'df2sos',... 'SystemObject',true);
Check the scaling.
ans = 2×3 3.1678 15.0757 1.4974 4.7360 52.6026 1.0000
Design an elliptic sos filter in the direct form I structure with default specifications.
EllipI = design(fdesign.lowpass('N,Fp,Ap,Ast',10,0.5,0.5,20), 'ellip',... 'FilterStructure', 'df1sos','SystemObject',true);
Check the scaling.
ans = 1×5 1.7078 2.0807 2.6084 7.1467 1.0000
pnorm— Different types of norm
Discrete-time-domain norm or a frequency-domain norm.
Valid time-domain norm values for
'linf'. Valid frequency-domain norm values are
'L2' norm is equal to
'l2' norm (by Parseval's theorem), but this
equivalency does not hold for other norms —
is not the same as
not the same as
arithType— Arithmetic type
Arithmetic type used during analysis, specified as
'fixed'. The function assumes a double precision
filter when the arithmetic input is not specified and the filter System
object is in an unlocked state.
s— Filter scaling
Filter scaling for a given p-norm. An optimally scaled filter has partial
norms equal to one. In such cases,
s contains all
For direct-form I (
df1sos) and direct-form II
df2tsos) filters, the function returns the
p-norm of the filter computed from the filter input to the output of each
second-order section. Therefore, the number of elements in
s is one less than the number of sections in the
filter. This p-norm computation does not include the trailing scale value of
the filter, which you can find by entering
hd.scalevalue(end) at the MATLAB prompt.
For direct-form II (
df2sos) and direct-form I
df1tsos) filters, the function returns a row
vector whose elements contain the p-norm from the filter input to the input
of the recursive part of each second-order section. This computation of the
p-norm corresponds to the input to the multipliers in these filter
structures. These inputs correspond to the locations in the signal flow
where overflow should be avoided.
hd has nontrivial scale values, that is, if any
scale values are not equal to one,
s is a two-row matrix,
rather than a vector. The first row elements of
the p-norm of the filter computed from the filter input to the output of
each second-order section. The elements of the second row of
s contain the p-norm computed from the input of the
filter to the input of each scale value between the sections. For
structures, the last numerator and the trailing scale value for the filter
are not included when
scalecheck checks the