Digital Signal Processing Reference
In-Depth Information
% Two's-complement numbers
s(:,1) = min(si',1-LSB); s(:,1) = max(s(:,1),-1); % initial values
% Filtering with rounding and two's-complement overflow mode
for n = 1:N
% output signal y[n] = b0*x[n] + s1[n] with word length reduction
b0x = LSB*round(b(1)*x(n)/LSB);
y(n) = b0x + s(1,n);
[y(n),OI] = overflow(y(n));
% two's-complement overflow
OC = OC + OI;
% state space variable 1
% s1[n+1] = b1*x[n] + s2[n] + 2*(-a1/2)*y[n] with word length
reduction
b1x = LSB*round(b(2)*x(n)/LSB);
a1y = LSB*round((-a(2)/2)*y(n)/LSB);
s(1,n+1) = b1x + s(2,n) + a1y + a1y;
[s(1,n+1),OI] = overflow(s(1,n+1));
% two's-complement overflow
OC = OC + OI;
% state space variable 2
% s2[n+1] = b2*x[n] + (-a2)*y[n] with word length reduction
b2x = LSB*round(b(3)*x(n)/LSB);
a2y = LSB*round(-a(3)*y(n)/LSB);
s(2,n+1) = b2x + a2y;
[s(2,n+1),OI] = overflow(s(2,n+1));
% two's-complement overflow
OC = OC + OI;
end
return
function [xO,OI] = overflow(x)
% Subfunction : two's-complement overflow detection
% [xO,OI] = overflow(x)
% x : input value
% xO : two's-complement repesentation
% OI : Overflow indicator (1: overflow, 0: no overflow)
xO = rem(x,2); OI = 0;
if xO <-1 || xO >= 1
% two's-complement overflow
xO = xO - 2*sign(xO); OI = 1;
end
return
M18.2
Großer Grenzzyklus
Wiederholen Sie die Messungen von vorhin mit den in Tabelle 18-4 angegebenen
Impulsamplituden. Tragen Sie die Messresultate dort ein und diskutieren Sie das Er-
gebnis.
Hinweis: Setzen Sie gegebenenfalls die Zahl der Simulationszyklen angemessen
hoch.
Wiederholen Sie die Untersuchungen des Systems 2. Ordnung für die Arithmetik
mit Betragsabschneiden und Sättigung, siehe Programm filt2_ts . Können große
Grenzzyklen beobachtet werden?
Search WWH ::




Custom Search