clc, clear all;
x=1:20;
hop = 2;
frameLen = 4;
yyy = [];
a = lpc(x,1);
y = filter([0 -a(2:end)],1,x);
plot (y(1:10),'r')
for i=1:4
frameRange = (1:frameLen) + (i-1)*hop;
xFrame = x(frameRange);
% a = lpc(xFrame,1); % when using this line, it won´t work any more.
yy(i,1:frameLen) = filter([0 -a(2:end)],1,xFrame);
yyy = [yyy yy(i,1+hop:frameLen)];
hold on
plot (frameRange,yy(i,1:frameLen),'k')
hold off
end
y
yyy = [yy(1,1:hop) yyy]
diff = y(1:length(yyy)) - yyy
hold on
plot (yyy,'--r')
hold off