Digital Signal Processing Reference
In-Depth Information
Tabelle 18-3
Beispiel für kleine Grenzzyklen in einem Block 2. Ordnung mit Runden
der Multiplikationsergebnisse auf eine Wortlänge von 16 Bits bei Impulser-
regung mit kleiner Amplitude 16*LSB . Angegeben sind die kleinsten und
größten Werte y min bzw. y max und die Periode der Grenzzyklen
Polwinkel M
y min / LSB
y max / LSB
Periode
30°
11
11
12
60°
90°
Wiederholen Sie die Untersuchungen des Blockes 2. Ordnung für die Arithmetik mit
Betragsabschneiden und Sättigung, siehe Programm filt2_ts . Können kleine
Grenzzyklen beobachtet werden?
Programmbeispiel 18-1 Untersuchung von Grenzzyklen in einem Block 2. Ordnung
% Limit cycles due to round-off in 2nd order block with quantized
% coefficients and fixed-point arithmetic
% used functions: filt2_rc.m, filt2_ts.m
% dsplab18_1.m * mw * 06/21/2008
w = 16; LSB = 2^(-w+1); % word length and LSB
MODE = 'rc' % rounding, two's-complement overflow
% MODE = 'ts' % truncation to zero, saturation arithmetic
rho = 0.95; phi = 30*pi/180;
% pole magnitude and phase
N = 200;
% number of simulation cycles
% Filter parameters
b = [.9375 0 0]; % numerator coefficients
a = [1 -2*rho*cos(phi) rho^2]; % denominator coefficients
si = [0; 0]; % initial values for state space variables
bq = LSB*round(b/LSB); % quantized coefficients
aq = [1 2*LSB*round((a(2)/2)/LSB) LSB*round(a(3)/LSB)];
% Input signal - impulse sequence - quantized
xq = zeros(1,N); xq(1) = 16*LSB;
% Referenz system : 2nd order block with MATLAB default arithmetic
[yref,zref] = filter(bq,aq,xq,si);
switch MODE
% 2nd order block with fixed-point arithmetic
case 'rc'
[y,s,OC] = filt2_rc(bq,aq,xq,si,w);
case 'ts'
[y,s,OC] = filt2_ts(bq,aq,xq,si,w);
otherwise
disp('Unknow method: MODE')
end
fprintf('overflow counter = %g\n',OC)
% Indicate overflow
% Search for limit cycle
Search WWH ::




Custom Search