Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fs=8000;
- t=0:1/fs:1;
- x=sin(2*pi*500*t);
- x=x+sin(2*pi*2100*t);
- bBP = [0.0201 0.0000 -0.0402 0.0000 0.0201 ]
- aBP = [1.0000 -2.1192 2.6952 -1.6924 0.6414 ]
- y=filter(bBP,aBP,x);
- Ak1=abs(fft(x))/length(x);
- k1=0:1:length(x)-1;
- f1=k1*fs/length(x);
- Ak2=abs(fft(y))/length(y);
- k2=0:1:length(y)-1;
- f2=k2*fs/length(y);
- figure(1);
- subplot(2,1,1)
- plot(f1,Ak1)
- subplot(2,1,2)
- plot(f2,Ak2)
- figure(2);
- freqz(bBP,aBP,512,fs);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement