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)); fh=fft(h,nfft); fh=fh(1:nfft/2); mul=fh.*fy; % plot(abs(mul/max(mul))) subplot(3,1,1) plot(xfft,abs(fy/max(fy))) subplot(3,1,2) plot(xfft,abs(fh/max(fh))) subplot(3,1,3) plot(xfft,abs(mul/max(mul)))