clear all,clc Fs=200e3; Ts=1/Fs; t=0:Ts:5e-3-Ts; f1=1e3; f2=20e3; f3=30e3; y=5*sin(2*pi*f1*t)+5*sin(2*pi*f2*t)+10*sin(2*pi*f3*t); plot(t,y) nfft=2^nextpow2(length(y)); fy=fft(y,nfft); fy=fy(1:nfft/2); xfft=Fs*(0:nfft/2-1)/nfft; plot(xfft,abs(fy)) % plot(xfft,abs(fy)/max(abs(fy))) cutoff=1.5e3/Fs/2; order=32; h=fir1(order,cutoff,hamming(order+1)); stem(h) con=conv(y,h); % plot(con) subplot(3,1,1) plot(t,y) subplot(3,1,2) stem(h) subplot(3,1,3) plot(con)