資源簡介
基于MATLAB仿真帶通濾波器的程序,包括歸一化波形,頻譜波形!
代碼片段和文件信息
%巴特沃斯帶通濾波器
clear?all
n=0:180;fs=2000;%采樣頻率2000hz
k=0:fs-1;f=2*k/fs;
x=cos(0.1*n*2*pi);%[(n-17)>=0]-[n-234>=0];
y=sin(0.015*n*2*pi);
w=x+y;
figure(1);
subplot(621);stem(x‘.‘);title(‘輸入信號x(n)‘);ylabel(‘x(n)‘);
subplot(623);stem(y‘.‘);title(‘輸入信號y(n)‘);ylabel(‘y(n)‘);
subplot(625);stem(w‘.‘);title(‘輸入信號w(n)‘);ylabel(‘w(n)‘)
X=fft(xfs);
subplot(622);plot(fabs(X));title(‘輸入信號x(n)幅頻曲線‘);ylabel(‘|FT[x(n)]|‘);
Y=fft(yfs);
W=fft(wfs);
subplot(626);plot(fabs(W));title(‘輸入信號w(n)幅頻曲線‘);ylabel(‘|FT[w(n)]|‘);
subplot(624);plot(fabs(Y));title(‘輸入信號y(n)幅頻曲線‘);ylabel(‘|FT[y(n)]|‘);
Wp=[2*pi*160/fs2*pi*310/fs];Ws=[2*pi*120/
評論
共有 條評論