[m,z] = filter(ones(1,P),P,x);