数字滤波器程序问题,麻烦大家帮看看
clear all%-------------------------------------------------------------
N=500;
p=0.05;
f=1/50;
n=1:N;
u=rand(1,N);
s=sin(2*pi*f*0:N-1);
x=u(1:N)+s;
subplot(311)
plot(x(1:500));grid on;
ylabel('x(n)')
%---------------------------------------------------------------
fp=200;
fs=400;Fs=1200;
rp=3;%通带衰减不大于3dB
rs=35;%阻带衰减不大于35dB
wp=2*fp/Fs;
ws=2*fs/Fs;
syms a w real
=buttord(wp,ws,rp,rs);
=butter(nz,wp,'low');
=freqz(bz,az,1024,Fs);
ih=ifourier(h);
subplot(312)
plot(x,h);grid;
ylabel('Low-pass DF')
%--------------------------------------------------------
y=fftfilt(h,x);
subplot(313)
plot(y);
画出的图不对,好像是逆傅里叶变换用的不太对似的。
页:
[1]
