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 FIR Digital Filters 583<br />

qn = round(qn*(2^bM)/(2*qnmax)+0.5); % Normalized en (interger between -K & K)<br />

qn = sort([qn,-K:1:(K+1)]); %<br />

H = diff(find(diff(qn)))-1; % Error histogram<br />

H = H/N;<br />

% Normalized histogram<br />

Hmax = max(H); Hmin = min(H);<br />

% Max and Min of the normalized histogram<br />

% Output SNRs<br />

SNR_C = 10*log10(varyn/varqn); % Computed SNR<br />

SNR_T = 6.02 + 6.02*B + 10*log10(sum(h.*h)/Xm^2) - 10*log10(M); % Theoretical SNR<br />

% Filter output with multi quant (1 multiplier)<br />

yq = QFix(yn,B,’round’,’satur’);<br />

% Output Error Analysis<br />

qn = yn-yq;<br />

% Outout error sequence<br />

varyn = var(yn); varqn = var(qn); % Signal and noise power<br />

qqmax = max(qn); qqmin = min(qn); % Maximun and minimum of the error<br />

qnmax = max(abs([qqmax,qqmin])); % Absolute maximum range of the error<br />

qnavg = mean(qn); qnstd = std(qn); % Mean and std dev of the error<br />

qn = round(qn*(2^bM)/(2*qnmax)+0.5); % Normalized en (interger between -K & K)<br />

qn = sort([qn,-K:1:(K+1)]); %<br />

H = diff(find(diff(qn)))-1; % Error histogram<br />

H = H/N;<br />

% Normalized histogram<br />

Hmax = max(H); Hmin = min(H);<br />

% Max and Min of the normalized histogram<br />

% Output SNRs<br />

SNR_C = 10*log10(varyn/varqn); % Computed SNR<br />

SNR_T = 6.02 + 6.02*B + 10*log10(sum(h.*h)/Xm^2); % Theoretical SNR<br />

The computed and theoretical SNRs as well as output error histograms for the<br />

two models are shown in Figure 10.27. The top plot shows the histogram when<br />

five multipliers are used. The output error has Gaussian-like distribution with<br />

SNR equal to 65.42 dB, which agrees with the theoretical value. The bottom<br />

plot show the histogram when one multiplier is used. As expected, the error is<br />

uniformly distributed with SNR equal to 72.43 dB, which also agrees with the<br />

theoretical one.<br />

□<br />

Cascade-form realization Let the filter be realized by a cascade of<br />

K, 2nd-order (M =3)sections given by<br />

H(z) =<br />

K∑<br />

H i (z) where H i (z) =β 0i + β 1i z −1 + β 2i z −2 (10.90)<br />

i=1<br />

as shown in Figure 10.28. The overall length of the filter is M =2K +1.<br />

Figure 10.28 also shows the finite word-length model for the cascade form,<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!