It looks like you are just implementing this difference equation
A = [1 -2 1]; B = [1 0 0 0 0 -2 0 0 0 0 0 1];
y = filter(B,A,x);
where x is the input to the filter and y is the output. Why not just use the above?
Also, your filter is a lowpass filter, but it does not look like a particularly good one, for one thing, it isn't stable.
Is there any reason you have to use this lowpass filter?
That is a lowpass filter, but it's
