Problem 1: The plot below verifies the solution of the LCCDE by
comparing the result of evaluating the solution for n=0..10 with the
result of filtering the input directly. As you can see, they are quite
close; the error is probably due to numerical precision error.
The matlab diary that produced
the plot is also show below.
% verifying solution to LCCDE
n=0:10;
xn = 2.^n;
b = [1 .5];
a = [1 -.7 .1];
yn = filter(b,a,xn);
% now with my solution
ym = -1.0567*(.5.^n) + .1417*(.2.^n) + 1.8152*(2.^n);
subplot(211)
plot(n,yn)
hold on
plot(n,ym,'r')
legend('filter output','LCCDE solution')
subplot 212
plot(n,yn-ym)
title('Error (Filter output - LCCDE solution)')