clear all clc N1=1024;t=0:1:N1-1; fs=5000; s=(sin(2*100*pi*t/fs)+sin(2*pi*500*t/fs)+2*sin(2*pi*1000*t/fs))+randn(1,length(t/fs)); Y=fft(s); wn1=[0.15 0.25]; b = fir1(32,wn1,'DC-0'); y1=filter(b,1,s); Y1=fft(y1); Ts=t(2)-t(1); Ws=2*pi/Ts; Wn=Ws/2; f=linspace(0,Wn/(2*pi),length(t)/2); Ya=abs(Y(1:leng