02.10.2019 Views

UploadFile_6417

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

444 Chapter 8 IIR FILTER DESIGN<br />

4. [b,a]=ellip(N,Rp,As,wn)<br />

This function designs an Nth-order lowpass digital elliptic filter with<br />

the passband ripple of Rp decibels and a stopband attenuation of As<br />

decibels. It returns the filter coefficients in length N +1 vectors b and<br />

a. The filter order is given by (8.62), and the cutoff frequency wn is the<br />

digital passband frequency in units of π; that is,<br />

ω n = ω p /π<br />

The use of this function is given in Example 8.24.<br />

All these above functions can also be used to design other frequencyselective<br />

filters, such as highpass and bandpass. We will discuss their<br />

additional capabilities in Section 8.6.<br />

There is also another set of filter functions, namely the buttord,<br />

cheb1ord, cheb2ord, and ellipord functions, which can provide filter<br />

order N and filter cutoff frequency ω n , given the specifications. These<br />

functions are available in the Signal Processing toolbox. In the examples<br />

to follow we will determine these parameters using the formulas given<br />

earlier. We will discuss the filter-order functions in the next section.<br />

In the following examples we will redesign the same lowpass filters<br />

of previous examples and compare their results. The specifications of the<br />

lowpass digital filter are<br />

ω p =0.2π, R p =1dB<br />

ω s =0.3π, A s =15dB<br />

□ EXAMPLE 8.21 Digital Butterworth lowpass filter design:<br />

>> % Digital Filter Specifications:<br />

>> wp = 0.2*pi; %digital Passband freq in rad<br />

>> ws = 0.3*pi; %digital Stopband freq in rad<br />

>> Rp = 1; %Passband ripple in dB<br />

>> As = 15; %Stopband attenuation in dB<br />

>> % Analog Prototype Specifications:<br />

>> T = 1; %Set T=1<br />

>> OmegaP = (2/T)*tan(wp/2); %Prewarp Prototype Passband freq<br />

>> OmegaS = (2/T)*tan(ws/2); %Prewarp Prototype Stopband freq<br />

>> % Analog Prototype Order Calculation:<br />

>> N =ceil((log10((10^(Rp/10)-1)/(10^(As/10)-1)))/(2*log10(OmegaP/OmegaS)));<br />

>> fprintf(’\n*** Butterworth Filter Order = %2.0f \n’,N)<br />

** Butterworth Filter Order = 6<br />

>> OmegaC = OmegaP/((10^(Rp/10)-1)^(1/(2*N))); %Analog BW prototype cutoff<br />

>> wn = 2*atan((OmegaC*T)/2); %Digital BW cutoff freq<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!