Download presentation
1
Chapter 8 FIR Filter Design
Content Introduction Properties of Linear-Phase FIR Filters Window Design Techniques Copyright © Shi Ping CUC
2
Copyright © 2005. Shi Ping CUC
Introduction The advantages of the FIR digital filter The phase response can be exactly linear; They are relatively easy to design since there are no stability problems; They are efficient to implement; The DFT can be used in their implementation. h(n)有限长,因此H(z)只在z=0处有极点,因此系统肯定是稳定的;另外,只要经过一定的延时,任何非因果有限长序列都能变成因果的有限长序列,因而总能用因果系统来实现。 Copyright © Shi Ping CUC
3
Copyright © 2005. Shi Ping CUC
Introduction The advantages of a linear-phase response Design problem contains only real arithmetic and not complex arithmetic; Linear-phase filter provide no delay distortion and only a fixed amount of delay; For the filter of length N (or order N-1) the number of operations are of the order of N/2. h(n)为实数偶对称,H(ejw)为实数 h(n)为实数奇对称,H(ejw)为纯虚数 Copyright © Shi Ping CUC
4
Copyright © 2005. Shi Ping CUC
Introduction The basic technique of FIR filter design Window design techniques; Frequency sampling design techniques; Optimal equiripple design techniques. return Copyright © Shi Ping CUC
5
Properties of Linear-Phase FIR Filters
The system function and frequency response The system function of FIR filters Let h(n), n=0,1,…,N-1 be the impulse response of length N. Then the system function is It has (N-1) poles at the origin and N-1 zeros located anywhere in the z-plane. Copyright © Shi Ping CUC
6
Properties of Linear-Phase FIR Filters
The frequency response of FIR filters Amplitude:振幅 Magnitude:幅度 Magnitude response function Amplitude response function Copyright © Shi Ping CUC
7
Properties of Linear-Phase FIR Filters
The difference between and is always positive and the associated phase response is a discontinuous function. may be both positive and negative and the associated phase response is a continuous function. Consider the following example: Copyright © Shi Ping CUC
8
Copyright © 2005. Shi Ping CUC
9
Properties of Linear-Phase FIR Filters
Linear-phase conditions For A constant group delay Copyright © Shi Ping CUC
10
Properties of Linear-Phase FIR Filters
For The phase response is through the origin. For The phase response is not through the origin. Copyright © Shi Ping CUC
11
Properties of Linear-Phase FIR Filters
Frequency response of linear-phase FIR filters Copyright © Shi Ping CUC
12
Properties of Linear-Phase FIR Filters
Copyright © Shi Ping CUC
13
Copyright © 2005. Shi Ping CUC
Symmetric impulse response Copyright © Shi Ping CUC
14
Copyright © 2005. Shi Ping CUC
Antisymmetric impulse response Copyright © Shi Ping CUC
15
Properties of Linear-Phase FIR Filters
The properties of amplitude function Type 1: symmetric impulse response, N is odd Cos((N-1)/2-n)也是以(N-1)/2为对称中心的偶对称函数。 Copyright © Shi Ping CUC
16
Properties of Linear-Phase FIR Filters
The middle sample Copyright © Shi Ping CUC
17
Properties of Linear-Phase FIR Filters
Type 2: symmetric impulse response, N is even Copyright © Shi Ping CUC
18
Properties of Linear-Phase FIR Filters
Type 3: antisymmetric impulse response, N is odd Copyright © Shi Ping CUC
19
Properties of Linear-Phase FIR Filters
Type 4: antisymmetric impulse response, N is even Type 3和Type4用来设计微分器和移相器 Copyright © Shi Ping CUC
20
Properties of Linear-Phase FIR Filters
Zero locations of linear-phase FIR filters If has a zero at Then for linear phase there must be a zero at 在黑板上讲P331的例子 For a real-valued filter, there must be zeros at Copyright © Shi Ping CUC return
21
Window Design Techniques
Basic window design idea Choose a proper ideal frequency-selective filter (which always has a noncausal, infinite-length impulse response); Then truncate (window) its impulse response to obtain a linear-phase and causal FIR filter. The emphasis is on Selecting an appropriate ideal filter; Selecting an appropriate windowing function. Copyright © Shi Ping CUC
22
Window Design Techniques
Denote an ideal frequency-selective filter by 由图可知,hd(n)是偶对称的,因此只能用类型1和2来设计。 Copyright © Shi Ping CUC
23
Copyright © 2005. Shi Ping CUC
Windowing Copyright © Shi Ping CUC
24
Copyright © 2005. Shi Ping CUC
The effect of Window function 设用矩形窗 WR(w):振幅函数 Copyright © Shi Ping CUC
25
Copyright © 2005. Shi Ping CUC
26
Window Design Techniques
The conclusion Since the window has a finite length equal to N, its response has a peaky main lobe whose width is proportional to 1/N, and has side lobes of smaller heights. The periodic convolution produces a smeared version of the ideal response The main lobe produces a transition band in whose width is responsible for the transition width. This width is then proportional to 1/N. The wider the main lobe, the wider will be the transition width. Smear:涂抹扩散 The side lobes produces ripples that have similar shapes in both the passband and stopband. Copyright © Shi Ping CUC
27
Window Design Techniques
Windowing functions Rectangular window This is the simplest window function but provides the worst performance from the viewpoint of stopband attenuation. The width of main lobe is 窗函数要满足两项要求: 1、窗谱主瓣要尽可能窄,以获得较陡的过渡带,即过渡带很窄 2、尽量减少窗谱最大旁瓣的相对幅度,也就是能量尽量集中于主瓣,这样使肩峰和波纹减小,就可以增大阻带的衰减。 但这两项要求不能同时满足,往往是增加主瓣宽度来换取对旁瓣的抑制。 Copyright © Shi Ping CUC
28
Window Design Techniques
Gibbs phenomenon The truncation of the infinite length will introduce ripples in frequency response The oscillatory behavior near the band edge of the filter is called the Gibbs phenomenon. When the N is increased: The transition band of the filter will decrease But the relative amplitude of the peaky values will remain constant. ---The transition band of the filter is determined by the main lobe width of the window function W(omega), When N increases, this width will decrease.(4*pi/N) ---the relative amplitude of the peaky values of the filter in stopband is determined by the relative amplitude of the side lobe of the window function W(omega). When N increases, this relative amplitude remain constant. 主瓣与旁瓣的相对比例由sinx/x决定,或者说只由窗函数的形状来决定,与N无关。 Copyright © Shi Ping CUC
29
Copyright © 2005. Shi Ping CUC
Bartlett window Since the Gibbs phenomenon results from the fact that the rectangular window has a sudden transition from 0 to 1 (or 1 to 0), Bartlett suggested a more gradual transition in the form of a triangular window. The width of main lobe is Copyright © Shi Ping CUC
30
Copyright © 2005. Shi Ping CUC
Hanning window This is a raised cosine window function given by: The width of main lobe is: Copyright © Shi Ping CUC
31
Copyright © 2005. Shi Ping CUC
Hamming window This is a modified version of the raised cosine window. The width of main lobe is: Copyright © Shi Ping CUC
32
Copyright © 2005. Shi Ping CUC
Blackman window This is a 2-order raised cosine window. The width of main lobe is: Copyright © Shi Ping CUC
33
Copyright © 2005. Shi Ping CUC
Kaiser window This is one of the most useful and optimum windows. Where is the modified zero-order Bessel function, and is a parameter that can be chosen to yield various transition widths and stopband attenuation. This window can provide different transition widths for the same N. Copyright © Shi Ping CUC
34
Copyright © 2005. Shi Ping CUC
The design equations for Kaiser window Given The norm transition width: The filter order N: Copyright © Shi Ping CUC
35
Min. stopband attenuation
Summary of window function characteristics Window name Window function Filter Peak value of side lobe The width of main lobe Transition width Min. stopband attenuation Rectangular -13 dB -21 dB Bartlett -25 dB Hanning -31 dB -44 dB Hamming -41 dB -53 dB Blackman -57 dB -74 dB 1、同一类窗函数,其过渡带宽度随窗宽度N的增加而减小。 2、同一类窗函数,其最小阻带衰减是固定的。 3、最小阻带衰减只由窗形状决定(不同的窗形其最大旁瓣相对幅度不同,最大旁瓣相对幅度越小,最小阻带衰减越大),不受N的影响; 4、最大旁瓣相对幅度越小的窗函数,其主瓣宽度也越宽,因而其滤波器的最小阻带衰减也越大,但同时过渡带也越宽; Copyright © Shi Ping CUC
36
Window Design Techniques
Design procedure Given the ideal frequency response Compute the impulse response of ideal filter Determine the window shape and N from the minimum stopband attenuation and the transition width Compute the impulse response of the designed filter Compute the frequency response of the designed filter and verify the performance Copyright © Shi Ping CUC
37
Window Design Techniques
Examples of FIR linear-phase filter design Digital FIR lowpass filter Example Design a digital FIR lowpass filter: Copyright © Shi Ping CUC
38
Copyright © 2005. Shi Ping CUC
Solution: Compute the digital frequencies Derive the frequency response of ideal FIR lowpass filter wc指的是两个肩峰之间的中心频率,因此由上述公式算出来的wc有一定的近似。 Copyright © Shi Ping CUC
39
Copyright © 2005. Shi Ping CUC
Compute the impulse response of the ideal filter Determine the window shape and N Both the Hamming and Blackman window can provide attenuation of more than 50dB. Let us choose the Hamming window, which provide the smaller transition band and hence has the smaller order. Hamming Copyright © Shi Ping CUC
40
Copyright © 2005. Shi Ping CUC
Compute the impulse response of the designed filter Copyright © Shi Ping CUC
41
Copyright © 2005. Shi Ping CUC
Compute the frequency response of the designed filter Verify the performance of the designed filter It is not satisfied by this design Let N = 34 and redesign 打开(digital signal processing\chap7\FIR_filter_design\lowpass_filter.m) 看ws=0.4pi处的衰减值,小于50dB,为46dB 因此需要将N加1,即N=33+1=34,重新设计,得到As为52dB。 Copyright © Shi Ping CUC
42
Window Design Techniques
Digital FIR highpass filter An ideal FIR highpass filter can be obtained from two ideal FIR lowpass filters, provided they have the same phase response. 截止频率为wc的理想高通滤波器相当于两个理想低通相减,一个是截止频率为pi的理想低通,一个是截止频率为wc的理想低通 Copyright © Shi Ping CUC
43
Copyright © 2005. Shi Ping CUC
The frequency response of an ideal FIR highpass filters The impulse response of an ideal FIR highpass filters Copyright © Shi Ping CUC
44
Copyright © 2005. Shi Ping CUC
Example Design a digital FIR highpass filter : Solution: Compute the digital frequencies Copyright © Shi Ping CUC
45
Copyright © 2005. Shi Ping CUC
Determine the window shape and N Blackman Note: the N must be odd for FIR highpass filters Derive the impulse response of ideal FIR highpass filter Copyright © Shi Ping CUC
46
Copyright © 2005. Shi Ping CUC
Compute the impulse response of the designed filter Copyright © Shi Ping CUC
47
Copyright © 2005. Shi Ping CUC
Compute the frequency response of the designed filter Verify the performance of the designed filter It is satisfied by this design Copyright © Shi Ping CUC
48
Window Design Techniques
Digital FIR bandpass filter An ideal FIR bandpass filter can be obtained from two ideal FIR lowpass filters, provided they have the same phase response. 截止频率为wc1和wc2的理想带通滤波器相当于两个理想低通相减,一个是截止频率为wc2的理想低通,一个是截止频率为wc1的理想低通 Copyright © Shi Ping CUC
49
Copyright © 2005. Shi Ping CUC
The frequency response of an ideal FIR bandpass filters The impulse response of an ideal FIR highpass filters 截止频率为wc1和wc2的理想带通滤波器相当于两个理想低通相减,一个是截止频率为wc2的理想低通,一个是截止频率为wc1的理想低通 Copyright © Shi Ping CUC
50
Copyright © 2005. Shi Ping CUC
Example Design a digital FIR bandpass filter : Solution: Compute the digital frequencies Copyright © Shi Ping CUC
51
Copyright © 2005. Shi Ping CUC
Determine the window shape and N Blackman Derive the impulse response of ideal FIR bandpass filter Copyright © Shi Ping CUC
52
Copyright © 2005. Shi Ping CUC
Compute the impulse response of the designed filter Copyright © Shi Ping CUC
53
Copyright © 2005. Shi Ping CUC
Compute the frequency response of the designed filter Verify the performance of the designed filter It is satisfied by this design Copyright © Shi Ping CUC
54
Copyright © 2005. Shi Ping CUC
Digital FIR bandstop filter An ideal FIR bandstop filter can be obtained from three ideal FIR lowpass filters, provided they have the same phase response. 截止频率为wc1和wc2的理想带阻滤波器相当于三个理想低通相加减,一个截止频率为pi的理想低通,减去一个截止频率为wc2的理想低通,再加上一个截止频率为wc1的理想低通 Copyright © Shi Ping CUC
55
Copyright © 2005. Shi Ping CUC
The frequency response of an ideal FIR bandpass filters The impulse response of an ideal FIR highpass filters Copyright © Shi Ping CUC
56
Copyright © 2005. Shi Ping CUC
Example Design a digital FIR bandstop filter : Solution: Compute the digital frequencies Copyright © Shi Ping CUC
57
Copyright © 2005. Shi Ping CUC
Determine the window shape and N Hanning Note: the N must be odd for FIR bandstop filters Derive the impulse response of ideal FIR bandstop filter Copyright © Shi Ping CUC
58
Copyright © 2005. Shi Ping CUC
Compute the impulse response of the designed filter Copyright © Shi Ping CUC
59
Copyright © 2005. Shi Ping CUC
Compute the frequency response of the designed filter Verify the performance of the designed filter It is satisfied by this design Copyright © Shi Ping CUC return
60
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\linear_phase_FIR\magVSamp.m) Piecewise:分段地 Copyright © Shi Ping CUC return
61
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\linear_phase_FIR\linear_phase_condition1.m) Copyright © Shi Ping CUC return
62
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\linear_phase_FIR\linear_phase_condition2.m) Copyright © Shi Ping CUC return
63
Copyright © 2005. Shi Ping CUC
偶对称 (digital signal processing\chap7\linear_phase_FIR\example1.m) Copyright © Shi Ping CUC return
64
Copyright © 2005. Shi Ping CUC
奇对称 (digital signal processing\chap7\linear_phase_FIR\example1.m) 不能用来设计高通、带阻滤波器 Copyright © Shi Ping CUC return
65
Copyright © 2005. Shi Ping CUC
奇对称 (digital signal processing\chap7\linear_phase_FIR\example1.m) 不能用来设计低通、高通、带阻滤波器 Copyright © Shi Ping CUC return
66
Copyright © 2005. Shi Ping CUC
偶对称 (digital signal processing\chap7\linear_phase_FIR\example1.m) 不能用来设计低通滤波器 Copyright © Shi Ping CUC return
67
Copyright © 2005. Shi Ping CUC
jIm[z] Re[z] Quadruplet Copyright © Shi Ping CUC return
68
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\impulse_of_Hd.m) wc=0.2pi, a=10 Copyright © Shi Ping CUC return
69
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\impulse_of_Hd.m) Copyright © Shi Ping CUC return
70
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\windowR_amplitude.m) Copyright © Shi Ping CUC return
71
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\Hw.m) Copyright © Shi Ping CUC return
72
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\Hw.m) Copyright © Shi Ping CUC
73
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\Hw.m) Copyright © Shi Ping CUC return
74
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\window_functions\rectangular_window.m) Copyright © Shi Ping CUC
75
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\window_functions\rectangular_window.m) Copyright © Shi Ping CUC return
76
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\Gibbs_phenomenon.m) Copyright © Shi Ping CUC
77
Copyright © 2005. Shi Ping CUC
78
Copyright © 2005. Shi Ping CUC
return
79
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\window_functions\bartlett_window.m) Copyright © Shi Ping CUC return
80
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\window_functions\hanning_window.m) Copyright © Shi Ping CUC return
81
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\window_functions\hamming_window.m) Copyright © Shi Ping CUC return
82
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\window_functions\blackman_window.m) Copyright © Shi Ping CUC return
83
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\window_functions\kaiser_window.m) Copyright © Shi Ping CUC
84
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\window_design\window_functions\kaiser_window.m) Copyright © Shi Ping CUC return
85
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\FIR_filter_design\lowpass_filter.m),N=33 Copyright © Shi Ping CUC return
86
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\FIR_filter_design\lowpass_filter.m),N=34 Copyright © Shi Ping CUC return
87
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\FIR_filter_design\highpass_filter.m),N=55 Copyright © Shi Ping CUC return
88
Copyright © 2005. Shi Ping CUC
return
89
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\FIR_filter_design\bandpass_filter.m),N=74 Copyright © Shi Ping CUC return
90
Copyright © 2005. Shi Ping CUC
return
91
Copyright © 2005. Shi Ping CUC
(digital signal processing\chap7\FIR_filter_design\bandstop_filter.m),N=63 Copyright © Shi Ping CUC return
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.