当前位置:首页 > 中北大学信息商务学院MATLAB实验报告
clear all;clc; fs=3000; f1=500; f2=1000;
t=0:1/fs:1-1/fs; s1=sin(2*pi*f1*t); s2=sin(2*pi*f2*t); s=s1+s2;
figure(1);plot(t,s); f=abs(fft(s)); ff=1:1500;
figure(2);plot(ff,f(1:1500));
a1=fir1(20,[495/1500,505/1500],'bandpass'); a2=fir1(20,[995/1500,1005/1500],'bandpass'); y1=filter(a1,1,s); y2=filter(a2,1,s); figure(3);
subplot(211);plot(y1); subplot(212);plot(y2);
共分享92篇相关文档