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.

500 Chapter 9 SAMPLING RATE CONVERSION<br />

Solution<br />

We will explore the intfilt function for the design using L = 5 and study the<br />

effect of alpha on the filter design. The following MATLAB script provides the<br />

detail.<br />

I = 4; L = 5;<br />

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

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

% (a) Full signal bandwidth: alpha = 1<br />

alpha = 1; h = intfilt(I,L,alpha);<br />

[Hr,w,a,L] = Hr_Type1(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,2,1); plot(ww/pi,Hr,’g’,’linewidth’,1.0); axis([0,1,-1,5]);<br />

set(gca,’xtick’,[0,1/I,1],’ytick’,[0,I]); grid; ylabel(’Amplitude’);<br />

title(’Amplitude Response: alpha = 1’,’fontsize’,TF)<br />

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

set(gca,’xtick’,[0,1/I,1],’ytick’,[-50,round(min_attn),0]); grid<br />

ylabel(’Decibels’); xlabel(’\omega/\pi’, ’fontsize’,10);<br />

title(’Log-mag Response: alpha = 1’,’fontsize’,TF)<br />

% (b) Partial signal bandwidth: alpha = 0.75<br />

alpha = 0.75; h = intfilt(I,L,alpha);<br />

[Hr,w,a,L] = Hr_Type1(h); Hr_min = max(Hr(end/2:end)); 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,2,2); plot(ww/pi,Hr,’g’,’linewidth’,1.0); axis([0,1,-1,5]);<br />

set(gca,’xtick’,[0,1/I,1],’ytick’,[0,I]); grid; ylabel(’Amplitude’);<br />

title(’Amplitude Response: alpha = 0.75’,’fontsize’,TF)<br />

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

set(gca,’xtick’,[0,1/I,1],’ytick’,[-50,round(min_attn),0]); grid<br />

ylabel(’Decibels’); xlabel(’\omega/\pi’, ’fontsize’,10);<br />

title(’Log-mag Response: alpha = 0.75’,’fontsize’,TF)<br />

The plots are shown in Figure 9.19. For the full bandwidth case of alpha = 1,<br />

the filter has more ripple in both the passband and the stopband with the<br />

minimum stopband attenuation of 22 DB. This is because the filter transition<br />

band is very narrow. For alpha = 0.75, the filter specifications are more lenient,<br />

and hence its response is well behaved with minimum stopband attenuation of<br />

40 DB. Note that we do not have complete control over other design parameters.<br />

These issues are discussed in more detail further along in this section. □<br />

In the following example, we design a linear-phase equiripple FIR<br />

interpolation filter using the Parks-McClellen algorithm.<br />

□ EXAMPLE 9.8 Design an interpolator that increases the input sampling rate by a factor of<br />

I =5.Use the firpm algorithm to determine the coefficients of the FIR filter<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!