To desing low pass FIR filter analysis and application

조회 수: 4 (최근 30일)
tilak tenneti
tilak tenneti 2013년 8월 31일
1.to design lp fir filter using fir1, fir2 ,firpm 2. use three cutoff frequencies 500-1000hz, 1001-2000hz,2001-3000hz 3.plot frequency response using freqz and fft 4.find the group delay using angle() unwrap() freqz() and diff() 5.filter signal using filter() and then play original and sound and filtered using soundsc() 6.compare the outputs of myfilter() function to implement filtering operation
amongst all these please let me know how can i use combination like plot ( 20*log10(abs(fft(b,8000)))); type of command..
i already used fir1 and got attenuation of min 40db .. played the original sound signal.. struggling with from 3rd step starting with fft and plot function
thankyou

채택된 답변

Youssef  Khmou
Youssef Khmou 2013년 9월 1일
Generally the returned values from filter design function are two vector a and b that represent the nominator and denominator of the the transfer function H, you can follow this protocol :
% Example of the vector a and b :
b=[1.2 0.9 1 2 2.3 6];
a=[1.6 0.75 1 1 -1 0.99];
N=512; % number of points for frequency computation
Fs=8000; % 8Khz
[h,f]=freqz(b,a,N,Fs);
figure, plot(f,20*log10(abs(h)));
  댓글 수: 2
tilak tenneti
tilak tenneti 2013년 9월 1일
hi youssef, in this case i have to take filter coefficients for b
i have tried this... x=wavread('thermo.wav'); soundsc(x,8000); b=fir1(100,0.385,'low'); a=fir1(200,0.475,'low'); N=512; Fs=8000; [h,f]=freqz(b,a,N,Fs); figure, plot(f,20*log10(abs(h)));
pls let me know how to use plot with diff angel and unwrap ??
Youssef  Khmou
Youssef Khmou 2013년 9월 2일
You can apply the Discrete Fourier Transform to vectors a and b you created :
a=fir1(200,0.475,'low');
Fa=fft(a);
figure, plot(20*log10(abs(Fa(1:end/2))));
figure,psd(a), % Built in function PSD
% Same goes for b .....
You can compute the phase angle as the following :
%Given your signal y original or filtered
Fy=fft(y);
P=unwrap(angle(Fy));
Frequency=(0:length(Fy)-1)'/length(Fy)*Fs;
figure, plot(Frequency,P);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by