章节目录 (10).ppt
2020/7/17,1,4.5 Simple Digital Filters简单的数字滤波器,Later in the course we shall review various methods of designing frequency-selective filters satisfying prescribed specifications We now describe several low-order FIR and IIR digital filters低阶FIR和IIR数字滤波器with reasonable selective frequency responses that often are satisfactory in a number of applications,2020/7/17,2,Simple FIR Digital Filters简单的FIR数字滤波器,FIR digital filters considered here have integer-valued impulse response coefficients These filters are employed in a number of practical applications, primarily because of their simplicity, which makes them amenable to inexpensive hardware implementations,2020/7/17,3,Simple FIR Digital Filters简单的FIR数字滤波器,Lowpass FIR Digital Filters低通FIR数字滤波器 The simplest lowpass FIR digital filter is the 2-point moving-average filter given by The above transfer function has a zero at and a pole at z = 0 Note that here the pole vector has a unity magnitude for all values of w,2020/7/17,4,Simple FIR Digital Filters简单的FIR数字滤波器,On the other hand, as w increases from 0 to p, the magnitude of the zero vector decreases from a value of 2, the diameter of the unit circle, to 0 Hence, the magnitude response is a monotonically decreasing function of w from w = 0 to w = p,2020/7/17,5,Simple FIR Digital Filters简单的FIR数字滤波器,The maximum value of the magnitude function is 1 at w = 0, and the minimum value is 0 at w = p, i.e., The frequency response of the above filter is given by,2020/7/17,6,Simple FIR Digital Filters简单的FIR数字滤波器,The magnitude response can be seen to be a monotonically decreasing function of w,2020/7/17,7,Simple FIR Digital Filters简单的FIR数字滤波器,The frequency at which is of practical interest since here the gain in dB is given by since the dc gain,G,G,G,2020/7/17,8,Simple FIR Digital Filters简单的FIR数字滤波器,Thus, the gain G(w) at is approximately 3 dB less than the gain at w = 0 As a result, is called the 3-dB cutoff frequency3-dB截止频率 To determine the value of we set which yields,2020/7/17,9,Simple FIR Digital Filters简单的FIR数字滤波器,The 3-dB cutoff frequency can be considered as the passband edge frequency As a result, for the filter the passband width is approximately p/2 The stopband is from p/2 to p Note: has a zero at or w = p, which is in the stopband of the filter,2020/7/17,10,Simple FIR Digital Filters简单的FIR数字滤波器,A cascade of the simple FIR filters results in an improved lowpass frequency response as illustrated below for a cascade of 3 sections,2020/7/17,11,Simple FIR Digital Filters简单的FIR数字滤波器,The 3-dB cutoff frequency of a cascade of M sections is given by For M = 3, the above yields Thus, the cascade of first-order sections yields a sharper magnitude response but at the expense of a decrease in the width of the passband,2020/7/17,12,Simple FIR Digital Filters简单的FIR数字滤波器,A better approximation to the ideal lowpass filter is given by a higher-order moving-average filter Signals with rapid fluctuations in sample values are generally associated with high-frequency components These high-frequency components are essentially removed by an moving-average filter resulting in a smoother output waveform,2020/7/17,13,Simple FIR Digital Filters简单的FIR数字滤波器,Highpass FIR Digital Filters高通FIR数字滤波器 The simplest highpass FIR filter is obtained from the simplest lowpass FIR filter by replacing z with This results in,2020/7/17,14,Simple FIR Digital Filters简单的FIR数字滤波器,Corresponding frequency response is given by whose magnitude response is plotted below,2020/7/17,15,Simple FIR Digital Filters简单的FIR数字滤波器,The monotonically increasing behavior of the magnitude function can again be demonstrated by examining the pole-zero pattern of the transfer function The highpass transfer function has a zero at z = 1 or w = 0 which is in the stopband of the filter,2020/7/17,16,Simple FIR Digital Filters简单的FIR数字滤波器,Improved highpass magnitude response can again be obtained by cascading several sections of the first-order highpass filter Alternately, a higher-order highpass filter of the form is obtained by replacing z with in the transfer function of a moving average filter,2020/7/17,17,Simple FIR Digital Filters简单的FIR数字滤波器,An application of the FIR highpass filters is in moving-target-indicator (MTI) radars动靶指示(MTI)雷达 In these radars, interfering signals, called clutters杂波, are generated from fixed objects in the path of the radar beam The clutter, generated mainly from ground echoes and weather returns, has frequency components near zero frequency (dc),2020/7/17,18,Simple FIR Digital Filters简单的FIR数字滤波器,The clutter can be removed by filtering the radar return signal through a two-pulse canceler双脉冲消除器, which is the first-order FIR highpass filter For a more effective removal it may be necessary to use a three-pulse canceler三脉冲消除器obtained by cascading two two-pulse cancelers,2020/7/17,19,Simple IIR Digital Filters简单的IIR数字滤波器,Lowpass IIR Digital Filters低通IIR数字滤波器 A first-order causal lowpass IIR digital filter has a transfer function given by where |a| < 1 for stability The above transfer function has a zero at i.e., at w = p which is in the stopband,2020/7/17,20,Simple IIR Digital Filters简单的IIR数字滤波器,has a real pole at z = a As w increases from 0 to p, the magnitude of the zero vector decreases from a value of 2 to 0, whereas, for a positive value of a, the magnitude of the pole vector increases from a value of to The maximum value of the magnitude function is 1 at w = 0, and the minimum value is 0 at w = p,2020/7/17,21,Simple IIR Digital Filters简单的IIR数字滤波器,i.e., and Therefore, is a monotonically decreasing function of w from w = 0 to w = p as indicated below,2020/7/17,22,Simple IIR Digital Filters简单的IIR数字滤波器,The squared magnitude function is given by The derivative of with respect to w is given by,2020/7/17,23,Simple IIR Digital Filters简单的IIR数字滤波器,in the range verifying again the monotonically decreasing behavior of the magnitude function To determine the 3-dB cutoff frequency we set in the expression for the square magnitude function resulting in,2020/7/17,24,Simple IIR Digital Filters简单的IIR数字滤波器,or which yields The above quadratic equation can be solved for a yielding two solutions,2020/7/17,25,Simple IIR Digital Filters简单的IIR数字滤波器,The solution resulting in a stable transfer function is given by It follows from that is a BR function for |a| < 1,2020/7/17,26,Simple IIR Digital Filters简单的IIR数字滤波器,Highpass IIR Digital Filters高通IIR数字滤波器 A first-order causal highpass IIR digital filter has a transfer function given by where |a| < 1 for stability The above transfer function has a zero at z = 1 i.e., at w = 0 which is in the stopband,2020/7/17,27,Simple IIR Digital Filters简单的IIR数字滤波器,Its 3-dB cutoff frequency is given by which is the same as that of Magnitude and gain responses of are shown below,2020/7/17,28,Simple IIR Digital Filters简单的IIR数字滤波器,is a BR function for |a| < 1 Example - Design a first-order highpass digital filter with a 3-dB cutoff frequency of 0.8p Now, and Therefore,2020/7/17,29,Simple IIR Digital Filters简单的IIR数字滤波器,Therefore,2020/7/17,30,Simple IIR Digital Filters简单的IIR数字滤波器,Bandpass IIR Digital Filters带通IIR数字滤波器 A 2nd-order bandpass digital transfer function is given by Its squared magnitude function is,2020/7/17,31,Simple IIR Digital Filters简单的IIR数字滤波器,goes to zero at w = 0 and w = p It assumes a maximum value of 1 at , called the center frequency of the bandpass filter, where The frequencies and where becomes 1/2 are called the 3-dB cutoff frequencies,2020/7/17,32,Simple IIR Digital Filters简单的IIR数字滤波器,The difference between the two cutoff frequencies, assuming is called the 3-dB bandwidth and is given by The transfer function is a BR function if |a| < 1 and |b| < 1,2020/7/17,33,Simple IIR Digital Filters简单的IIR数字滤波器,Plots of are shown below,2020/7/17,34,Simple IIR Digital Filters,Example - Design a 2nd order bandpass digital filter with center frequency at 0.4p and a 3-dB bandwidth of 0.1p Here and The solution of the above equation yields: a = 1.376382 and a = 0.72654253,2020/7/17,35,Simple IIR Digital Filters简单的IIR数字滤波器,The corresponding transfer functions are and The poles of are at z = 0.3671712 and have a magnitude 1,2020/7/17,36,Simple IIR Digital Filters简单的IIR数字滤波器,Thus, the poles of are outside the unit circle making the transfer function unstable On the other hand, the poles of are at z = and have a magnitude of 0.8523746 Hence is BIBO stable Later we outline a simpler stability test,2020/7/17,37,Simple IIR Digital Filters简单的IIR数字滤波器,Figures below show the plots of the magnitude function and the group delay of,2020/7/17,38,Simple IIR Digital Filters简单的IIR数字滤波器,Bandstop IIR Digital Filters带阻IIR数字滤波器 A 2nd-order bandstop digital filter has a transfer function given by The transfer function is a BR function if |a| < 1 and |b| < 1,2020/7/17,39,Simple IIR Digital Filters,Its magnitude response is plotted below,2020/7/17,40,Simple IIR Digital Filters简单的IIR数字滤波器,Here, the magnitude function takes the maximum value of 1 at w = 0 and w = p It goes to 0 at , where , called the notch frequency陷波频率, is given by The digital transfer function is more commonly called a notch filter陷波滤波器,2020/7/17,41,Simple IIR Digital Filters简单的IIR数字滤波器,The frequencies and where becomes 1/2 are called the 3-dB cutoff frequencies The difference between the two cutoff frequencies, assuming is called the 3-dB notch bandwidth and is given by,2020/7/17,42,Simple IIR Digital Filters简单的IIR数字滤波器,Higher-Order IIR Digital Filters高阶IIR数字滤波器 By cascading the simple digital filters discussed so far, we can implement digital filters with sharper magnitude responses Consider a cascade of K first-order lowpass sections characterized by the transfer function,2020/7/17,43,Simple IIR Digital Filters简单的IIR数字滤波器,The overall structure has a transfer function given by The corresponding squared-magnitude function is given by,2020/7/17,44,Simple IIR Digital Filters简单的IIR数字滤波器,To determine the relation between its 3-dB cutoff frequency and the parameter a, we set which when solved for a, yields for a stable :,2020/7/17,45,Simple IIR Digital Filters简单的IIR数字滤波器,where It should be noted that the expression for a given earlier reduces to for K = 1,2020/7/17,46,Simple IIR Digital Filters简单的IIR数字滤波器,Example - Design a lowpass filter with a 3-dB cutoff frequency at using a single first-order section and a cascade of 4 first-order sections, and compare their gain responses For the single first-order lowpass filter we have,2020/7/17,47,Simple IIR Digital Filters简单的IIR数字滤波器,For the cascade of 4 first-order sections, we substitute K = 4 and get Next we compute,2020/7/17,48,Simple IIR Digital Filters简单的IIR数字滤波器,The gain responses of the two filters are shown below As can be seen, cascading has resulted in a sharper roll-off in the gain response,Passband details,2020/7/17,49,% Exercise 3.3.2. A Cascaded System.,clc; clear; close all; % Step (a). Display the Magnitude of H1(j? and H2(j?. h1 = -0.04 0.04 0.3 -0.6 0.3 0.04 -0.04 ; n1 = 0:6; h2 = 0.09 -0.12 -0.5 -0.5 0.12 0.09; n2 = 0:5; w H1 = my_DTFT(h1,n1); w H2 = my_DTFT(h2,n2); figure(Name,Exercise 3.3.2. A Cascaded System); subplot(3,2,1); plot(w,abs(H1); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) ylim(0 1.15); xlim(0 pi); grid on; title(|itH_1(jomega)|); subplot(3,2,2); plot(w,angle(H1); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) xlim(0 pi); grid on; title(angleitH_1(jomega); subplot(3,2,3) plot(w,abs(H2); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) ylim(0 1.15); xlim(0 pi); grid on; title(|itH_2(jomega)|); subplot(3,2,4) plot(w,angle(H2); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) xlim(0 pi); grid on; title(angleitH_2(jomega);,2020/7/17,50,% Step (b). Display the Magnitude of H3(j? = DTFTconv(h1n,h2n). n3 h3 = my_conv(h1,h2,n1,n2); % This signal has length of 7+6-1 = 12. % Durates from n = 0 to n = 11. w H3 = my_DTFT(h3,n3); % Plot the results. subplot(3,2,6) plot(w,angle(H3); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) xlabel(omega (rad/sample); hold on; xlim(0 pi); grid on; title(angleitH_3(jomega) = angleitH_1(jomega)*itH_2(jomega); subplot(3,2,5) plot(w,abs(H3); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) xlabel(omega (rad/sample); xlim(0 pi); grid on; title(|itH_3(jomega)| = |itH_1(jomega)|*|itH_2(jomega)|); hold on; % Verify that this is true: disp(Press any key to continue.); pause(); stem(w,abs(H1.*H2),r.,Marker,none); subplot(3,2,6) stem(w,angle(H1.*H2),r.,Marker,none); xlim(0 pi); grid on;,2020/7/17,51,result,2020/7/17,52,Exercise 3.3.3. A Parallel System.,clc; clear; close all; % Step (a). Display the Magnitude of H1(j? and H2(j?. h1 = 0.04 -0.04 -0.3 0.6 -0.3 -0.04 0.04 ; n1 = 0:6; h2 = 0.09 -0.12 -0.5 -0.5 0.12 0.09; n2 = 0:5; w H1 = my_DTFT(h1,n1); w H2 = my_DTFT(h2,n2); figure(Name,Exercise 3.3.3. A Parallel System); subplot(3,2,1); plot(w,abs(H1); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) ylim(0 1.15); xlim(0 pi); grid on; title(|itH_1(jomega)|); subplot(3,2,2); plot(w,angle(H1); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) xlim(0 pi); grid on; title(angleitH_1(jomega); subplot(3,2,3) plot(w,abs(H2); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) ylim(0 1.15); xlim(0 pi); grid on; title(|itH_2(jomega)|); subplot(3,2,4); plot(w,angle(H2); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) xlim(0 pi); grid on; title(angleitH_2(jomega);,2020/7/17,53,% Step (b). Display the Magnitude of H3(j? = DTFTh1n + h2n). h3 = h1(1:6)+h2 h1(7); % Durates from n = 0 to n = 6. n3 = n1; w H3 = my_DTFT(h3,n3); % Plot the results. subplot(3,2,6) plot(w,angle(H3); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) xlabel(omega (rad/sample); hold on; xlim(0 pi); grid on; title(angleitH_3(jomega) = angleitH_1(jomega)+itH_2(jomega); subplot(3,2,5) plot(w,abs(H3); set(gca,XTick,0 pi/4 pi/2 3*pi/4 pi); set(gca,XTickLabel,0,pi/4,pi/2,3pi/4,pi ) xlabel(omega (rad/sample); xlim(0 pi); ylim(0 1); grid on; title(|itH_3(jomega)| = |DTFTith_1n + ith_2n| = |itH_1(jomega)+itH_2(jomega)|); hold on; % Verify that this is true: disp(Press any key to continue.); pause(); stem(w,abs(H1+H2),r.,Marker,none); subplot(3,2,6) stem(w,angle(H1 + H2),r.,Marker,none); xlim(0 pi); grid on;,2020/7/17,54,result,2020/7/17,55,Comb Filters梳状滤波器,The simple filters discussed so far are characterized either by a single passband and/or a single stopband There are applications where filters with multiple passbands and stopbands are required The comb filter is an example of such filters,2020/7/17,56,Comb Filters梳状滤波器,In its most gene