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.

Round-off Effects in IIR Digital Filters 557<br />

with zero initial conditions. This filter has two complex-conjugate poles and<br />

hence is a bandpass filter. Let the input be x(n) =0.375δ(n). Analyze the limit<br />

cycle behavior using a 3-bit quantizer.<br />

Solution<br />

In the filter implementation the coefficient products are quantized, which<br />

results in<br />

% Bandpass filter<br />

a1 = 0.875; a2 = -0.75;<br />

ŷ(n) =Q[0.875ŷ(n − 1)] −Q[0.75ŷ(n − 2)] + x(n) (10.35)<br />

where ŷ(n) isthe quantized output. We simulate (10.35) in MATLAB using<br />

both the rounding and truncation operations.<br />

% Rounding operation in multipliers<br />

yn1 = 0; yn2 = 0;<br />

m = 0:20; y = [yn2,yn1,zeros(1,length(m))];<br />

x = 0.375*impseq(m(1),m(1)-2,m(end));<br />

for n = m+3<br />

yn1 = y(n-1); yn2 = y(n-2);<br />

y(n) = QFix(a1*yn1,3,’round’,’satur’)+QFix(a2*yn2,3,’round’,’satur’)+x(n);<br />

end<br />

subplot(’position’,[0.1,0.2,0.39,0.6]);<br />

plot([-1,20],[0,0],’w’); axis([-1,20,-0.5,0.5]); hold on;<br />

Hs_1 = stem([-2,-1,m],y,’filled’); set(Hs_1,’markersize’,3,’color’,[0,1,0]);<br />

set(gca,’ytick’,[-0.5:0.25:0.5],’fontsize’,6); ylabel(’Amplitude’,’fontsize’,8);<br />

title(’Rounding Operation’,’fontsize’,10);<br />

xlabel(’Sample index n’,’fontsize’,8);<br />

% Truncation operation in multipliers<br />

yn1 = 0; yn2 = 0;<br />

m = 0:20; y = [yn2,yn1,zeros(1,length(m))];<br />

x = 0.375*impseq(m(1),m(1)-2,m(end));<br />

for n = m+3<br />

yn1 = y(n-1); yn2 = y(n-2);<br />

y(n) = QFix(a1*yn1,3,’trunc’,’satur’)+QFix(a2*yn2,3,’trunc’,’satur’)+x(n);<br />

end<br />

subplot(’position’,[0.59,0.2,0.39,0.6]);<br />

plot([-1,20],[0,0],’w’); axis([-1,20,-0.5,0.5]); hold on;<br />

Hs_1 = stem([-2,-1,m],y,’filled’); set(Hs_1,’markersize’,3,’color’,[0,1,0]);<br />

set(gca,’ytick’,[-0.5:0.25:0.5],’fontsize’,6); ylabel(’Amplitude’,’fontsize’,8);<br />

title(’Truncation Operation’,’fontsize’,10);<br />

xlabel(’Sample index n’,’fontsize’,8);<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!