Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fs=8000;
- t=0:1/fs:0.5;
- x=4*cos(2*pi*400*t)+4*cos(2*pi*900*t+0.5*pi)+5*cos(2*pi*400*t+0.25*pi);
- 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];
- a =[1];
- y=filter(bLP,a,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(bLP,a,512,fs);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement