fs=8000; t=0:1/fs:1; x1=4*cos(2*pi*400*t); x2=4*cos(2*pi*900*t+0.5*pi); x3=5*cos(2*pi*400*t+0.25*pi); xt=x1+x2+x3; a=1; bLP =[ -0.0012 -0.0025 -0.0045 -0.0068 -0.0073 -0.0030 0.0089 ... 0.0297 0.0583 0.0907 0.1208 0.1422 0.1500 0.1422 ... 0.1208 0.0907 0.0583 0.0297 0.0089 -0.0030 -0.0073 ... -0.0068 -0.0045 -0.0025 -0.0012]; bBP =[ 0.0004 -0.0017 -0.0064 -0.0076 0.0073 0.0363 0.0458 ... 0.0000 -0.0802 -0.1134 -0.0419 0.0860 0.1500 0.0860 ... -0.0419 -0.1134 -0.0802 0.0000 0.0458 0.0363 0.0073 ... -0.0076 -0.0064 -0.0017 0.0004 ]; figure(1) freqz(bLP,a,512,fs); figure(2) freqz(bBP,a,512,fs); y1=filter(bBP,a,xt); Ak1=abs(fft(y1))/length(y1); k1=0:1:length(y1)-1; f1=k1*fs/length(y1); y2=filter(bLP,a,xt); Ak2=abs(fft(y2))/length(y2); k2=0:1:length(y2)-1; f2=k2*fs/length(y2); Ak3=abs(fft(xt))/length(xt); k3=0:1:length(xt)-1; f3=k3*fs/length(xt); figure(3) subplot(3,1,1) plot(f3,Ak3) title('x(t)') subplot(3,1,2) plot(f1,Ak1) title('band pass untuk y1') subplot(3,1,3) plot(f2,Ak2) title('low pass untuk y2')