02.10.2019 Views

UploadFile_6417

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

518 Chapter 9 SAMPLING RATE CONVERSION<br />

Solution<br />

The FIR filter that meets the specifications of this problem is exactly the same<br />

as the filter designed in Example 9.8. Its bandwidth is π/5.<br />

□<br />

□ EXAMPLE 9.16 A signal x(n) has a total bandwidth of 0.9π. Itisresampled by a factor of<br />

4/3 toobtain y(m). We want to preserve the frequency band up to 0.8π and<br />

require that the band up to 0.7π be free of aliasing. Using the Parks-McClellan<br />

algorithm, determine the coefficients of the FIR filter that has 0.1 dB ripple in<br />

the passband and 40 dB attenuation in the stopband.<br />

Solution<br />

The overall signal bandwidth is ω x,s1 =0.9π, the bandwidth to be preserved is<br />

ω x,p =0.8π, and the bandwidth above which aliasing is tolerated is ω x,s2 =0.7π.<br />

From (9.60) and using I =4and D =3,the FIR filter design parameters are<br />

ω p =0.2π and ω s =0.275π. With these parameters, along with the passband<br />

ripple of 0.1 dB and stopband attenuation of 40 dB, the optimum FIR filter<br />

length is 58. The details and computation of design plots follow.<br />

% Given Parameters:<br />

I = 4; D = 3; Rp = 0.1; As = 40;<br />

wxp = 0.8*pi; wxs1 = 0.9*pi; wxs2 = 0.7*pi;<br />

% Computed Filter Parameters<br />

wp = wxp/I; ws = min((2*pi/I-wxs1/I),(2*pi/D-wxs2/I));<br />

% Filter Design<br />

[delta1,delta2] = db2delta(Rp,As);<br />

[N,F,A,weights] = firpmord([wp,ws]/pi,[1,0],[delta1,delta2],2);<br />

N = ceil(N/2)*2+1; h = firpm(N,F,I*A,weights);<br />

Hf1 = figure(’units’,’inches’,’position’,[1,1,6,3],...<br />

’paperunits’,’inches’,’paperposition’,[0,0,6,3]);<br />

% Filter Design Plots<br />

[Hr,w,a,L] = Ampl_res(h); Hr_min = min(Hr); w_min = find(Hr == Hr_min);<br />

H = abs(freqz(h,1,w)); Hdb = 20*log10(H/max(H)); min_attn = Hdb(w_min);<br />

subplot(2,1,1); plot(w/pi,Hr,’m’,’linewidth’,1.0); axis([0,1,-0.1,I+0.1]);<br />

set(gca,’xtick’,[0,wp/pi,ws/pi,1],’ytick’,[0,I]); grid;<br />

ylabel(’Amplitude’,’vertical’,’cap’);<br />

title(’Amplitude Response’,’fontsize’,TF,’vertical’,’baseline’);<br />

xlabel(’Frequency in \pi units’,’vertical’,’middle’);<br />

subplot(2,1,2); plot(w/pi,Hdb,’m’,’linewidth’,1.0); axis([0,1,-60,10]);<br />

set(gca,’xtick’,[0,wp/pi,ws/pi,1],’ytick’,[-60,round(min_attn),0]); grid<br />

ylabel(’Decibels’,’vertical’,’cap’);<br />

xlabel(’Frequency in \pi units’,’vertical’,’middle’);<br />

title(’Log-magnitude Response’,’fontsize’,TF,’vertical’,’baseline’);<br />

The filter responses are shown in Figure 9.29, which shows that the designed<br />

filter achieves the attenuation of 40 db.<br />

□<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!