Filter Design Toolbox    

iirlpnorm Examples

Each of these examples uses one or more feature provided in the function iirlpnorm. The examples build on one another, although they can be run separately. Review each example to get an overview of the capabilities of the function.

Example -- Using iirlpnorm to Design a Lowpass Filter

To design a lowpass filter with maximum gain of 1.6 in the passband, we use the syntax iirlpnorm(n,d,f,edges,a,w). To duplicate the filter in the figure, use this code.

When you look at the magnitude response curve, notice the response reaches 1.6 in the passband.

s

Example -- Using iirlpnorm to Design a Low Order Filter

The curves in the next figure show the results of using iirlpnorm to design a low-order filter with a single band. For this design, we introduce a new two-element vector P=[Pmin,Pmax] that defines the minimum and maximum values of P in the least-pth norm algorithm. If you do not specify P, the default values are [2 128], resulting in the L or Chebyshev norm. Specify Pmin and Pmax to be even numbers. To view the placement of the poles and zeros for your filter before the optimization takes place, replace [Pmin Pmax] with the string 'inspect'. With the option 'inspect' in use, the algorithm does not optimize the filter design.

We specified a lowpass filter with third-order numerator and denominator, and used the P vector to limit the optimization range, by using the function syntax iirlpnorm(n,d,f,edges,a,w,p).

Setting W=[1 1 1 1 1] is the same as not setting weight values.

Example -- Using iirlpnorm to Design a Bandstop Filter

Designing IIR bandstop filters is straightforward. Enter the frequency, magnitude, edges, and weight vectors using the syntax iirlpnorm(n,d,f,edges,a,w) as shown here. To ensure that the stopband rejects undesired frequencies aggressively, we weight the magnitude response in the stopband more heavily by entering the weight vector [1 1 5 5 1 1], telling the optimization algorithm that meeting the inband response specification is five times as important as meeting the out-of-band response.

As you can see from the following figure, the filter meets our design needs quite closely.

Example -- Using iirlpnorm to Design a Noise-Shaping Filter

In this example, we create a lowpass filter with a rising magnitude in the passband. Communications designers use the filter when they simulate the effects of motion between a transmitter and receiver, such as you find in cellular telephone networks. Here, we use iirlpnorm to design the same filter. Because of the complex shape of the passband, we define the vectors f, a, w, and edges in the workspace, then use the vector names in the iirlpnorm statement.

When you compare the figure below to the filter design in Getting Started with the Toolbox, you see they match very well.


  Advanced IIR Filter Designs iirlpnormc Examples 

Learn more about the latest releases of MathWorks products:

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