Download presentation
Presentation is loading. Please wait.
1
Finite-duration impulse response (FIR) filter (Order=M-1, Length=M) The impulse response The system function The difference equation (Linear convolution) The frequency response (DTFT) Linear-phase FIR filters
2
Linear-phase FIR filter (Order=M-1, Length=M) = 0, /2. is a constant Four types Linear-phase FIR filters
3
Type-1 linear-phase FIR filter (Symmetrical, M odd) = 0. = (M-1)/2 (integer) Symmetric about (the index of symmetry) Linear-phase FIR filters
4
Type-2 linear-phase FIR filter (Symmetrical, M even) = 0. = (M-1)/2 (non-integer) Linear-phase FIR filters
5
Type-3 linear-phase FIR filter (Antisymmetrical, M odd) = /2. = (M-1)/2 (integer) Linear-phase FIR filters
6
Type-4 linear-phase FIR filter (Antisymmetrical, M even) = /2. = (M-1)/2 (non-integer) Linear-phase FIR filters
7
Design Specs (LPF) FIR LPF filter specifications: (a) Absolute (b) Relative Band [0, p ]: pass band Band [ s, ]: stop band Band [ p, s ]: transition band 1 : Absolute ripple in pass band 2 : Absolute ripple in stop band R p : Relative ripple in pass band (in dB) A s : Relative ripple in stop band (in dB)
8
Design Specs (LPF)
9
Window Design Techniques Shifting
10
Window Design Techniques General Design Procedures: : Ideal frequency response (given) Step 1 Step 2 Step 3 Window function symmetric about over 0 otherwise
11
Window Design Techniques Rectangular Window Exact transition width = s - p = 1.8 /M Min. stopband attenuation = 21dB MATLAB function: w=boxcar (M)
12
Window Design Techniques Bartlett Window Exact transition width = s - p = 6.1 /M Min. stopband attenuation = 25dB MATLAB function: w=bartlett (M)
13
Window Design Techniques Hann Window Exact transition width = s - p = 6.2 /M Min. stopband attenuation = 44dB MATLAB function: w=hann (M)
14
Window Design Techniques Hamming Window Exact transition width = s - p = 6.6 /M Min. stopband attenuation = 53dB MATLAB function: w=hamming (M)
15
Window Design Techniques Blackman Window Exact transition width = s - p = 11 /M Min. stopband attenuation = 74dB MATLAB function: w=blackman (M)
16
Window Design Techniques LPF Design function hd=ideal_lp(wc,M) %hd: ideal LPF impulse response between 0 and M-1 %wc: cut-off frequencies in radians %M: length of the filter alpha=(M-1)/2; n=[0:M-1]; m=n-alpha; fc=wc/pi; hd=fc*sinc(fc*m);
17
Window Design Techniques LPF Design %Example 1 in FIR filter design wp=0.2*pi; ws=0.3*pi; tr_width=ws-wp; M=ceil(6.6*pi/tr_width)+1; n=[0:M-1]; wc=(ws+wp)/2; %ideal cutoff frequency hd=ideal_lp(wc,M); w_hamming=(hamming(M))'; h=hd.*w_hamming; figure(1);stem(n,h); title('h(n)') figure(2);freqz(h,[1]) Example: p =0.2 s =0.3 A s =50 dB
18
Window Design Techniques
20
BPS example: 1s =0.2 , 1p =0.35 , 2p =0.65 , 2s =0.8 A s =60 dB Two transition band widths must be the same!
21
Window Design Techniques %Example 2 in FIR filter design % BPS design wp1=0.35*pi; ws1=0.2*pi; wp2=0.65*pi; ws2=0.8*pi; %only one transition bandwidth allowed in window design tr_width=min(wp1-ws1,ws2-wp2); M=ceil(11*pi/tr_width)+1; n=[0:M-1]; wc1=(ws1+wp1)/2; %ideal cutoff frequency 1 wc2=(ws2+wp2)/2; %ideal cutoff frequency 2 hd=ideal_lp(wc2,M)-ideal_lp(wc1,M); w_blackman=(blackman(M))'; h=hd.*w_blackman; figure(1);stem(n,h); title('h(n)') figure(2);freqz(h,[1])
22
Window Design Techniques
24
Example: Digital differentiator %Example 2 in FIR filter design % Digital differentiator design M=21;alpha=(M-1)/2;n=0:M-1; hd=(cos(pi*(n-alpha)))./(n-alpha);hd(alpha+1)=0; w_ham=(hamming(M))'; h=hd.*w_ham; [H,W]=freqz(h,[1]); plot(W/pi,abs(H)); title('Digital differentiator: |H(\omega)|')
25
Window Design Techniques
27
>> t=linspace(-2,2,1000); >> xt=sin(2*pi*t);yt=conv(xt,h); >> subplot(2,1,1);plot(xt);title('x(t)=sin(2\pit)') >> subplot(2,1,2);plot(yt(22:end));title('y(t)=Dx(t)')
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.