滤波器初始化状态 避免瞬时噪声 方法之一
% prepend sequence with mirror image of first points so that transients
% can be eliminated. then do same thing at right end of data sequence.
nfilt = nfilt+1;
itemp = 2*idata(1) - idata((nfilt+1):-1:2);%起始点 做成镜像,奇对称 ;初始化状态,避免瞬时噪声
[itemp,zi]=filter(b,1,itemp); %#ok 获取zi初始化状态
[odata,zf] = filter(b,1,idata,zi); 滤波