Products & Services Industries Academia Support User Community Company

Learn more about Filter Design Toolbox   

norm - P-norm of filter

Syntax

l = norm(ha)
l = norm(ha,pnorm)
l = norm(hd)
l = norm(hd,pnorm)
l = norm(hm)
l = norm(hm,pnorm)

Description

All of the variants of norm return the filter p-norm for the object in the syntax, either an adaptive filter, a digital filter, or a multirate filter. When you omit the pnorm argument, norm returns the L2-norm for the object.

Note that by Parseval's theorem, the L2-norm of a filter is equal to the l2 norm. This equality is not true for the other norm variants.

For adaptfilt Objects

l = norm(ha) returns the L2-norm of an adaptive filter.l = norm(ha,pnorm) adds the input argument pnorm to let you specify the norm returned. pnorm can be either

For dfilt Objects

l = norm(hd) returns the L2-norm of a discrete-time filter.

l = norm(hd,pnorm) includes input argument pnorm that lets you specify the norm returned. pnorm can be either

By Parseval's theorem, the L2-norm of a filter is equal to the l2 norm. This equality is not true for the other norm variants.

IIR filters respond slightly differently to norm. When you compute the l2, linf, L1, and L2 norms for an IIR filter, norm(...,L2,tol) lets you specify the tolerance for the accuracy in the computation. For l1, l2, L2, and linf, norm uses the tolerance to truncate the infinite impulse response that it uses to calculate the norm. For L1, norm passes the tolerance to the numerical integration algorithm. Refer to Examples to see this in use. You cannot specify Linf for the norm and include the tol option.

For mfilt Objects

l = norm(hm) returns the L2-norm of a multirate filter.

l = norm(hm,pnorm) includes argument pnorm to let you specify the norm returned. pnorm can be either

Note that, by Parseval's theorem, the L2-norm of a filter is equal to the l2 norm. This equality is not true for the other norm variants.

Examples

Adaptfilt Objects

For the adaptive filter example, compute the 2-norm of an adaptfilt object, here an LMS-based adaptive filter.

ha = adaptfilt.lms; % norm(ha) is zero because all coeffs are zero
% Create some data to filter to generate filter coeffs
x = randn(100,1);
d = x + randn(100,1);
[y,e] = filter(ha,x,d);
l2 = norm(ha); % Now norm(ha) is nonzero
l2 =

    1.1231

Dfilt Objects

To demonstrate the tolerance option used with an IIR filter (dfilt object), compute the 2-norm of filter hd with a tolerance of 1e-10.

d=fdesign.lowpass('n,fc',5,0.4)
 
d =
 
               Response: 'Lowpass with cutoff'
          Specification: 'N,Fc'
            Description: {2x1 cell}
    NormalizedFrequency: true
                     Fs: 'Normalized'
            FilterOrder: 5
                Fcutoff: 0.4000


hd = butter(d);
l2=norm(hd,'l2',1e-10)

l2 =

    0.6336

Mfilt Objects

In this example, compute the infinity norm of an FIR polyphase interpolator, which is an mfilt object.

hm = mfilt.firinterp;
linf = norm(hm,'linf'); 
linf =

    1

See Also

reorder, scale, scalecheck

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

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