Contents
b = [1 2 1]; a = [1 -1.4 .74];
State-space representation in transposed direct form II
A2t = [-a(2) 1; -a(3) 0];
B2t = [b(2)-a(2)*b(1); b(3)-a(3)*b(1)];
C2t = [1 0];
D2t = b(1);
Transformation of transposed direct form II to non-transposed
A2 = [0 1;1 0]*A2t'*[0 1;1 0];
B2 = [0 1;1 0]*C2t';
C2 = B2t'*[0 1;1 0];
D2 = D2t;
Filtering
x = [1 zeros(1,50)];
S = [0;0];
y = zeros(size(x));
for n=1:length(x)
y(n) = C2*S + D2*x(n);
S = A2*S + B2*x(n);
end
Graphics - Impulse response
FIG = figure('Name','lab1_2 : Impulse response',...
'NumberTitle','off','Units','normalized','Position',[.3 .5 .4 .32]);
stem(0:length(x)-1,y/max(abs(y)),'filled')
axis([0 50 -.5 1]); grid;
xlabel('n \rightarrow'), ylabel('h[n] / MAX \rightarrow')
text(.82*50,.86,['MAX = ',num2str(max(abs(y)))])
title('Impulse response')