Contents

% quantization of stable 2nd order block coefficients with two's complement
% for (transposed) direct form II an normal form
% lab3_2.m * mw * 08/02/2007

Discrete numbers (quantized)

w = 5;        % word length
K = 2^(w-1);
LSB = 1/K;    % LSB, least significant bit
xq = zeros(1,K);
for k=1:K-1
    xq(k+1) = k*LSB;
end
xq = [-fliplr(xq(2:K)) xq]; % set of quantized numbers
FIG1 = figure('Name','lab3_1:  Set of quantized numbers','NumberTitle','off',...
    'Units','normalized','Position',[.3 .5 .325 .5]);
plot(xq,'o'), grid
ylabel('[x]_q \rightarrow'), xlabel('index \rightarrow')

(transposed) direct form II

p = [];
for l=1:2*K-1
    for m=1:2*K-1
        z01 = -xq(l) + sqrt(xq(l)^2-xq(m));
        if abs(z01) < 1
            p = [p z01];
        end
        z02 = -xq(l) - sqrt(xq(l)^2-xq(m));
        if abs(z02) < 1
            p = [p z02];
        end
    end
end
FIG2 = figure('Name',['lab3_2 : Quantized poles for direct form II  (w=', num2str(w),')'],'NumberTitle','off',...
    'Units','normalized','Position',[.3 .5 .325 .5]);
scatter(real(p),imag(p),'.'),grid
ylabel('Im( z_\infty ) \rightarrow'), xlabel('Re( z_\infty ) \rightarrow')

Normal form

p = [];
for l=1:2*K-1
    for m=1:2*K-1
        z = xq(l)+j*xq(m);
        if abs(z)<1
            p = [p z];
        end
    end
end
FIG3 = figure('Name',['lab3_2 : Quantized poles for normal form  (w=', num2str(w),')'],'NumberTitle','off',...
    'Units','normalized','Position',[.3 .5 .325 .5]);
scatter(real(p),imag(p),'.'),grid
ylabel('Im( z_\infty ) \rightarrow'), xlabel('Re( z_\infty ) \rightarrow')