Main Content

filternorm

2-norm or infinity-norm of digital filter

    Description

    L = filternorm(b,a) computes the 2-norm of a stable digital filter defined by the numerator coefficients b and denominator coefficients a.

    L = filternorm(___,pnorm) specifies the type of filter norm to compute for the digital filter.

    example

    L = filternorm(___,tol) specifies the tolerance allowed in the filter norm computation.

    example

    Examples

    collapse all

    Compute the 2-norm of a Butterworth IIR filter with tolerance 10-10. Specify a normalized cutoff frequency of 0.5π rad/s and a filter order of 5.

    [b1,a1] = butter(5,0.5);
    L2 = filternorm(b1,a1,2,1e-10)
    L2 = 
    0.7071
    

    Compute the infinity-norm of an FIR Hilbert transform of order 30 and normalized transition width 0.2π rad/s.

    b2 = firpm(30,[.1 .9],[1 1],"Hilbert");
    Linf = filternorm(b2,1,inf)
    Linf = 
    1.0028
    

    Input Arguments

    collapse all

    Filter numerator coefficients, specified as a real-valued vector.

    Data Types: double
    Complex Number Support: Yes

    Filter denominator coefficients, specified as a real-valued vector.

    Data Types: double
    Complex Number Support: Yes

    Type of filter norm to compute for the digital filter, specified as one of these:

    • 2 — The function computes the 2-norm of the filter.

    • inf — The function computes the infinity-norm of the filter.

    Data Types: double

    Tolerance allowed for filter norm estimation, specified as a positive scalar.

    Note

    You can specify the tol argument only for IIR 2-norm computations, which only applies if you set pnorm to 2.

    Data Types: single | double
    Complex Number Support: Yes

    Output Arguments

    collapse all

    Filter norm, returned as a real positive scalar.

    Tips

    • A typical use for filter norms is in digital filter scaling to reduce quantization effects. Scaling often improves the signal-to-noise ratio of the filter without resulting in data overflow. You also can use the 2-norm to compute the energy of the impulse response of a filter.

    Algorithms

    Given a filter with frequency response H(e), the Lp-norm for 1 ≤ p < ∞ is given by

    H(ejω)p=(12πππ|H(ejω)|pdω)1/p.

    For the case p → ∞, the L-norm is

    H(ejω)=maxπωπ|H(ejω)|.

    For the case p = 2, Parseval's theorem states that

    H(ejω)2=(12πππ|H(ejω)|2dω)1/2=(n|h(n)|2)1/2,

    where h(n) is the impulse response of the filter. The energy of the impulse response is the squared L2-norm.

    References

    [1] Jackson, L. B. Digital Filters and Signal Processing: with MATLAB Exercises. 3rd Ed. Hingham, MA: Kluwer Academic Publishers, 1996, Chapter 11.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced before R2006a

    See Also

    |