http://www.docin.com/p-754061711.html
% 零相位数字滤波
n = 1:1:512;
x = 3* sin(2*pi*133*n/10000) + cos(2*pi*2333*n/10000);
[B A]=cheby1(5,0.2,0.1,'low'); %切比雪夫1型,5阶,0.2截止低通,0.1等波纹
freqz(B, A);
y = filtfilt(B ,A, x);
y2 = filter(B, A, x);
figure;
subplot(2,1,1)
plot(x);
title('原始信号');
subplot(2,1,2)
plot(y);%零相位
hold on;
plot(y2, 'r');%相位偏移(FIR恒定常量,IIR变量)