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.

574 Chapter 10 ROUND-OFF EFFECTS IN DIGITAL FILTERS<br />

% Filter output without multiplication quantization<br />

yn = filter(1,a,xn); % output using filter routine<br />

% Filter output with multiplication quantization<br />

yq = zeros(1,N); % Initialize quantized output array<br />

yq(1) = xn(1); % sample yq(1)<br />

yq(2) = QFix((xn(2)-a1*yq(1)),B,’round’,’satur’); % sample yq(2)<br />

for I = 3:N;<br />

yq(I) = xn(I)-a1*yq(I-1)-a2*yq(I-2); % Unquantized sample<br />

yq(I) = QFix(yq(I),B,’round’,’satur’); % Quantized sample<br />

end<br />

% Output Error Analysis<br />

en = yn-yq;<br />

% Output error sequence<br />

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

eemax = max(en); eemin = min(en); % Maximum and minimum of the error<br />

enmax = max(abs([eemax,eemin])); % Absolute maximum range of the error<br />

enavg = mean(en); enstd = std(en); % Mean and std dev of the error<br />

en = round(en*(2^bM)/(2*enmax)+0.5); % Normalized en (integer between -M & M)<br />

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

H = diff(find(diff(en)))-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/varen);<br />

% Computed SNR<br />

SNR_T = 6.02 + 6.02*B + 20*log10(Xm); % Theoretical SNR<br />

SNR_L = 6.02 + 6.02*B + 20*log10(Xm_L); % Lower SNR bound<br />

SNR_U = 6.02 + 6.02*B + 20*log10(Xm_U); % Upper SNR bound<br />

The part of the script not shown above also computes and plots the normalized<br />

histogram of the output error and prints the statistical values in the plot, as<br />

shown in Figure 10.23. The error again has a Gaussian distribution. The exact<br />

value of the output SNR is 25.22 dB, which agrees with the computed value of<br />

25.11 dB and lies between the lower bound of 20.89 dB and the upper bound<br />

of 26.47 dB. Similar results done for B =12bits are shown in Figure 10.24.<br />

Again, the simulation results agree with the model results.<br />

□<br />

10.2.8 HIGHER-ORDER FILTERS<br />

The analysis of the quantization effects in a second-order filter can be<br />

applied directly to higher-order filters based on a parallel realization.<br />

In this case each 2nd-order filter section is independent of all the other<br />

sections, and therefore the total quantization noise power at the output<br />

of the parallel structure is simply the linear sum of the quantization noise<br />

powers of each of the individual sections. On the other hand, the cascade<br />

realization is more difficult to analyze because the noise generated in any<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!