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.

512 Chapter 9 SAMPLING RATE CONVERSION<br />

m = delay+1:1:128/D+delay+1; y = y(m); m = 0:16; y = y(16:32);<br />

subplot(2,2,3); Hs2 = stem(m,y,’filled’); set(Hs2,’markersize’,2,’color’,’m’);<br />

axis([-1,17,-1.2,1.2]); set(gca,’xtick’,[0:8:32]/D,’ytick’,[-1,0,1]);<br />

title(’Output signal: y1(n): D=2’,’fontsize’,TF,’vertical’,’baseline’);<br />

xlabel(’m’,’vertical’,’middle’); ylabel(’Amplitude’);<br />

% Input signal x2(n) = cos(8*pi*n/16)<br />

n = [0:256]; x = cos(8*pi*n/(16));<br />

n1 = n(1:33); x1 = x(33:65); % for plotting purposes<br />

subplot(2,2,2); Hs1 = stem(n1,x1,’filled’); set(Hs1,’markersize’,2,’color’,’g’);<br />

set(gca,’xtick’,[0:8:32],’ytick’,[-1,0,1]);<br />

axis([-2,34,-1.2,1.2]); ylabel(’Amplitude’); xlabel(’n’,’vertical’,’middle’);<br />

Title(’Input Signal: x2(n) = cos(\pin/2)’,’fontsize’,TF,’vertical’,’baseline’);<br />

% Decimation of x2(n): D = 2<br />

y = upfirdn(x,[h],1,D); %y = downsample(conv(x,h),2);<br />

m = delay+1:1:128/D+delay+1; y = y(m); m = 0:16; y = y(16:32);<br />

subplot(2,2,4); Hs2 = stem(m,y,’filled’); set(Hs2,’markersize’,2,’color’,’m’);<br />

axis([-1,17,-1.2,1.2]); set(gca,’xtick’,[0:8:32]/D,’ytick’,[-1,0,1]);<br />

title(’Output signal: y2(n): D=2’,’fontsize’,TF,’vertical’,’baseline’);<br />

xlabel(’m’,’vertical’,’middle’); ylabel(’Amplitude’);<br />

The signal stem plots are shown in Figure 9.26. The leftside plots show the<br />

signal x 1(n) and the corresponding decimated signal y 1(n), and the rightside<br />

plots show the same for x 2(n) and y 2(n). In both cases the decimation appears<br />

to be correct. If we had chosen any frequency above π/2, then the filter would<br />

have attenuated or eliminated the signal.<br />

□<br />

9.5.4 DESIGN SPECIFICATIONS<br />

When we replace the ideal lowpass filter H D (ω) byafinite-order FIR filter<br />

H(ω), we must allow for a transition band. Again we define<br />

• ω x,p as the signal bandwidth to be preserved<br />

• ω x,s as the frequency above which aliasing error is tolerated<br />

Then we have 0

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

Saved successfully!

Ooh no, something went wrong!