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.

FIR Filter Designs for Sampling Rate Conversion 509<br />

x(n)<br />

FIR Decimator<br />

FIR LPF<br />

H(ω)<br />

v(n)<br />

↓D<br />

y(m)<br />

FIGURE 9.24<br />

Rate: F x<br />

F x<br />

An FIR integer decimator<br />

F x<br />

= F y<br />

D<br />

which is nothing but the aliased sum of the H(ω)X(ω). Thus, the condition<br />

necessary to avoid aliasing is<br />

π<br />

H(ω)X(ω) =0 for ≤|ω| ≤π (9.54)<br />

D<br />

Then,<br />

Y (ω y )= 1 X(ω)H(ω) (9.55)<br />

D<br />

as in (9.25), where the ideal filtering was accomplished with H D (ω) as<br />

given in (9.20).<br />

□ EXAMPLE 9.11 Design a decimator that downsamples an input signal x(n) byafactor D =2.<br />

Use the firpm algorithm to determine the coefficients of the FIR filter that has<br />

a0.1 dBripple in the passband and is down by at least 30 dB in the stopband.<br />

Choose reasonable values for band-edge frequencies.<br />

Solution<br />

The passband cutoff frequency should be ω p = π/D =0.5π. Toget a reasonable<br />

value for the filter length we choose the transition width of 0.1π, which gives<br />

stopband a cutoff frequency of ω s =0.3π. Afilter of length M =37achieves the<br />

preceding design specifications. The details are given in the following MATLAB<br />

script.<br />

% Filter Design<br />

D = 2; Rp = 0.1; As = 30; wp = pi/D; ws = wp+0.1*pi;<br />

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

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

h = firpm(N,F,A,weights); n = [0:length(h)-1];<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 />

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

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

subplot(2,2,1); Hs1 = stem(n,h,’filled’); set(Hs1,’markersize’,2);<br />

axis([-1,length(n),-0.15,0.6]); ylabel(’Amplitude’,’vertical’,’cap’);<br />

xlabel(’n’,’vertical’,’bottom’);set(gca,’xtick’,[n(1),n(end)],’ytick’,[0,0.5]);<br />

Title(’Impulse Response’,’fontsize’,TF,’vertical’,’baseline’);<br />

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

set(gca,’xtick’,[0,wp/pi,ws/pi,1],’ytick’,[0,1]); grid;<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!