




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、Digital Filter Design Using MatlabBy Timothy J. SchlichterEE 4000 Introduction to Digital Filtering5/2/99Submitted to: Dr. Joseph PiconeMississippi State UniversityDepartment of Electrical and Computer EngineeringEXECUTIVE SUMMARYA fundamental aspect of signal processing is filtering. Filtering invo
2、lves the manipulationof the spectrum of a signal by passing or blocking certain portions of the spectrum,depending on the frequency of those portions. Filters are designed according to what kindof manipulation of the signal is required for a particular application. Digital filters areimplemented usi
3、ng three fundamental building blocks: an adder, a multiplier, and a delayelement.The design process of a digital filter is long and tedious if done by hand. With the aid ofcomputer programs performing filter design algorithms, designing and optimizing filterscan be done relatively quickly. This pape
4、r discusses the use of Matlab, a mathematicalsoftware package, to design, manipulate, and analyze digital filters.The design options in Matlab allow the user to either create a code for designing filtersthat calls built-in functions, or to design filters in Sptool, a graphical user interface. Eachof
5、 these methods are examined in this paper. The strengths and weaknesses of each aredetailed in the following discussion.This paper concludes with a discussion of how the data given by Matlab for various filterscan be used to implement filters on real digital signal processors. Matlab provides all th
6、einformation necessary for building a hardware replica of the filter designed in software.TABLE OF CONTENTS1. Abstract.42. Introduction. .43. Lowpass Filter Design74. Highpass and Bandpass Filter Design115. Sptool.136. Future Directions167. Acknowledgments.168. References.169. Appendix.17AbstractMat
7、lab provides different options for digital filter design, which include function calls tofilter algorithms and a graphical user interface called Sptool. A variety of filter designalgorithms are available in Matlab for both IIR and FIR filters. This paper discusses thedifferent options in Matlab and
8、gives examples of lowpass, highpass, and bandpass filterdesigns.Results show that the graphical user interface Sptool is a quicker and simpler option thanthe option of making function calls to the filter algorithms. Sptool has a more user-friendly environment since the spectrum of the filter is imme
9、diately displayed to the user,and the user can quickly zoom in and examine particular areas of interest in the spectrum(i.e. the passband). However, the shortcoming of Sptool is that it only displays themagnitude response of the filter, not the phase response.IntroductionA key element in processing
10、digital signals is the filter. Filters perform directmanipulations on the spectra of signals. To completely describe digital filters, three basicelements (or building blocks) are needed: an adder, a multiplier, and a delay element. Theadder has two inputs and one output, and it simply adds the two i
11、nputs together. Themultiplier is a gain element, and it multiplies the input signal by a constant. The delayelement delays the incoming signal by one sample. Digital filters can be implementedusing either a block diagram or a signal flow graph. Figure 1 shows the three basicelements in block diagram
12、 form, and Figure 2 shows them in signal flow graph form.With the basic building blocks at hand, the two different filter structures can easily beimplemented. These two structures are Infinite Impulse Response (IIR) and FiniteImpulse Response (FIR), depending on the form of the systems response to a
13、 unit pulseinput. IIR filters are commonly implemented using a feedback (recursive) structure, whileFIR filters usually require no feedback (non-recursive).In the design of IIR filters, a commonly used approach is called the bilineartransformation. This design begins with the transfer function of an
14、 analog filter, thenperforms a mapping from the s-domain to the z-domain. Using differential equations, itcan be shown (Proakis 677) that the mapping from the s-plane to the z-plane isThis mapping results in a general form for an IIR filter with an arbitrary number of polesand zeros. The system resp
15、onse and the difference equation for this filter is as follows:This system response can be easily realized using a signal flow graphAn FIR filter has a difference equation ofBy taking the z-transform, the system response isThe realization of an FIR filter using a signal flow graph is straightforward
16、.Matlab has several design algorithms that can be used to create and analyze both IIR andFIR digital filters. The IIR filters that can be created in Matlab are Butterworth,Chebyshev type 1 and 2, and elliptic. The FIR filter algorithms in Matlab are equiripple,least squares, and Kaiser window. The M
17、atlab code required to implement these filtersinvolves bilinear transformations and function calls to analog prototype filters. Thefollowing sections give examples of Matlab implementation of the IIR filters listed above.Lowpass Filter DesignUsing Matlab, a lowpass digital filter is designed using v
18、arious analog prototypes:Chebyshev, Butterworth, and Elliptic. The optimum filter type is chosen on the basis ofimplementation complexity, magnitude response, and phase response. The designspecifications for the filter are as follows: Cutoff frequency = 1000Hz Sample frequency = 8000Hz Passband ripp
19、le = 0.5dB Stopband attn. = 60dB Transition band = 100HzMatlab Code (Chebyshev):% Lowpass digital filter with Chebyshev-I analog prototype% Digital Filter Specifications:wp = 0.125*2*pi; % digital passband frequency in Hz (normalized)ws = 0.1375*2*pi; % digital stopband frequency in Hz (normalized)R
20、p = 0.5; % passband ripple in dBAs = 20; % stopband attenuation in dB% Analog Prototype Specifications:Fs = 1; T = 1/Fs;OmegaP = (2/T)*tan(wp/2); % prewarp prototype passband frequencyOmegaS = (2/T)*tan(ws/2); % prewarp prototype stopband frequency% Analog Chebyshev-1 Prototype Filter Calculation:c,
21、 d = chb1(OmegaP, OmegaS, Rp, As);% Bilinear Transformation:b, a = bilinear(cs, ds, Fs);%db,mag,pha,grd,w = freqz(b,a);plot(w*8000/2/pi,db);xlabel('frequency (Hz)'); ylabel('decibels'); title('Magnitude indB');This exact code is also used for the elliptic and Butterworth desi
22、gns. The only change isin the filter calculations of each type. Instead of calling chb1(), the elliptic filter designcalls a function “elliptic()” and the Butterworth design calls a function“butterworth()”. See the appendix for the Matlab code of the function chb1().The following figures show the ma
23、gnitude and phase responses of each type of filter.Magnitude Response of Chebyshev FilterPhase of Chebyshev FilterMagnitude Response of Elliptic FilterPhase of Elliptic FilterMagnitude Response of Butterworth FilterPhase of Butterworth FilterThe Matlab code outputs the filter order and the filter co
24、efficients. For this example, theChebyshev filter order was nine. The elliptic filter had an order of five, and theButterworth filter order was thirty-two.Several conclusions can be drawn about these low-pass filter designs from this simpleexample. First, in general, for a given set of design constr
25、aints, the elliptic filter designalgorithm will result in the simplest filter (in terms of complexity). The most complexfilter is the Butterworth filter with an order of thirty-two. In terms of passband ripple, theButterworth filter gives the optimum response. In the passband, there is almost no rip
26、ple(monotonic). The elliptic and Chebyshev filters both have much more ripple in thepassband. So, there is a tradeoff between these three different types of filters. In terms ofmagnitude response and complexity, the elliptic ripple is most likely the optimum choice.However, the elliptic ripple has a
27、 phase response that is more nonlinear than theChebyshev and Butterworth filters. Therefore, if a sharp cutoff and relatively lowcomplexity is required, the choice would be the elliptic filter. If the phase response wouldneed to be more linear, a Chebyshev or Butterworth filter should be chosen over
28、 theelliptic filter.Highpass andBandpass Filter DesignMatlab provides functions for implementing lowpass-to-highpass and lowpass-to-bandpassconversions. By providing a filter order, the passband ripple, and the 3dB cutofffrequency to the function cheby1(), a highpass filter can be designed. The filt
29、er order isfound using the function chebord(). For a Butterworth prototype, the functions arebutter() and buttord(). For the elliptic prototype, the functions are ellip() andellipord().The following Matlab code is used to design a Chebyshev highpass digital filter with apassband at 1100Hz and a 100H
30、z transition band.% Highpass Chebyshev Digital Filterws = 0.125*2*pi; % digital stopband frequency in rad/swp = 0.1375*2*pi; % digital passband frequency in rad/sRp = 0.5; % passband ripple in dBAs = 20;N,wn = cheb1ord(wp/pi,ws/pi,Rp,As);b,a = cheby1(N, Rp, wn, 'high');db,mag,pha,grd,w = fre
31、qz_m(b,a);plot(w*8000/2/pi,db);axis(800 1200 -22 1);The following figure shows the magnitude response of the highpass filter.Magnitude Response of Chebyshev FilterBandpass filters are found using these same two functions. However, with bandpassfilters, the passband and stopband frequencies (wp and w
32、s) are two-element vectors sincethere are two passband frequencies and two stopband frequencies. The Matlab codebelow shows the design of an elliptic digital bandpass filter.% Bandpass Elliptic Digital Filterws = 0.3*pi 0.75*pi %Stopband edge frequencywp = 0.4*pi 0.6*pi %Passband edge frequencyRp =
33、0.5; %Passband ripple in dBAs = 20; %Stopband attenuation in dBN,wn = ellipord(wp/pi,ws/pi,Rp,As);b,a = ellip(N,Rp,As,wn);db,mag,pha,grd,w = freqz_m(b,a);plot(w*8000/2/pi,db);axis(500 3500 -22 1);xlabel('frequency (Hz)'); ylabel('decibels'); title('Magnitude Response of Elliptic
34、Filter');The following figure shows the magnitude response of the bandpass filter designed in theMatlab code above.Magnitude Response of Elliptic FilterSptoolMatlab has a very useful visualization tool for designing and analyzing digital filters calledSignal Processing Tool, or Sptool. Sptool is
35、 a graphical user interface capable ofanalyzing and manipulating signals, filters, and spectra. For filter design, Sptool allowsthe user to select the filter design algorithm to use when creating the filter. The designalgorithms included in Sptool are FIR filters (equiripple, least squares, Kaiser w
36、indow)and IIR filters (Butterworth, Chebyshev type 1 and 2, elliptic). The user is also allowed tospecify the type of filter (lowpass, bandpass, highpass, or bandstop). Sptool designs thefilter and displays the magnitude response and the filter order.The figures below show actual Sptool screenshots
37、for a lowpass filter design using thespecifications given above. The Chebyshev Type 1 algorithm was used for thesescreenshots. By using the zoom options, different parts of the spectrum can be analyzedquickly and easily with Sptool. The second screenshot is a windowed view of thepassband of the spec
38、trum contained in the first screenshot.Future DirectionsDigital filters can be quickly and easily designed in Matlab using the methods describedabove. Sptool offers a much quicker way of designing and comparing different filters thanusing the function calls to the filter algorithms. However, Sptool
39、allows the user to viewthe magnitude response of the filter, not the phase response. For some applications, thephase response may be more important than the magnitude response, so in these casesSptool would not be as useful in determining the optimum filter design. Also, Sptool doesnot give a direct
40、 output of the filter coefficients. With the Matlab code given above, thefilter coefficient are displayed to the user.The results from Matlab can be used directly to implement the digital filters on real DSPs.These results are all that is needed to draw a complete signal flow graph with adders,multi
41、pliers, and delay elements. The filter coefficients are used as the gain factors for themultipliers, and shift registers are used as the delay elements (for each z-n factor).AcknowledgmentsMany thanks to Dr. Joseph Picone for his guidance, assistance, and time in the executionof this project.Referen
42、ces Hanselman, Duane, and Littlefield, Bruce. Mastering Matlab 5. Prentice Hall. UpperSaddle River, NJ, 1998. Ingle, Vinay K. and Proakis, John G. Digital Signal Processing Using Matlab. PWSPublishing Company, 1997. Proakis, John G. and Manolakis, Dimitris G. Digital Signal Processing: Principles,Algorithms, and Applications, 3rd Edition. Prentice Hall. Upper Saddle River, NJ,1996. Ziemer,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 民辦教育機(jī)構(gòu)2025年合規(guī)運營與品牌建設(shè)教育資源共享效益評估報告
- 2025年環(huán)保產(chǎn)業(yè)園區(qū)產(chǎn)業(yè)集聚與區(qū)域綠色產(chǎn)業(yè)協(xié)同發(fā)展啟示研究報告
- 2025年工業(yè)互聯(lián)網(wǎng)平臺自然語言處理技術(shù)在智能文本生成式翻譯系統(tǒng)中的應(yīng)用報告
- 2025年干細(xì)胞療法在阿爾茨海默病治療中的應(yīng)用進(jìn)展報告
- 2025年醫(yī)院電子病歷系統(tǒng)優(yōu)化構(gòu)建醫(yī)療大數(shù)據(jù)平臺報告
- 咨詢工程師基礎(chǔ)課件
- 2025年醫(yī)藥企業(yè)研發(fā)外包(CRO)模式下的臨床試驗數(shù)據(jù)管理系統(tǒng)的功能與性能報告
- 2025年儲能技術(shù)多元化在儲能系統(tǒng)成本控制中的應(yīng)用報告
- 2025年醫(yī)藥流通供應(yīng)鏈優(yōu)化與成本控制技術(shù)革新報告
- 成人教育終身學(xué)習(xí)體系構(gòu)建與平臺運營中的在線教育平臺用戶活躍度研究報告
- 消防管理檢查評分表
- 制造執(zhí)行系統(tǒng)SMT MES解決方案
- 高二區(qū)域地理 撒哈拉以南的非洲課件
- 數(shù)字化精密加工車間項目可行性研究報告建議書
- 2022年《內(nèi)蒙古自治區(qū)建設(shè)工程費用定額》取費說明
- Q∕GDW 10799.6-2018 國家電網(wǎng)有限公司電力安全工作規(guī)程 第6部分:光伏電站部分
- 寧波市建設(shè)工程資料統(tǒng)一用表(2022版)1 通用分冊
- 危險化學(xué)品安全技術(shù)說明書MSDS—汽油
- 三甲醫(yī)院必備醫(yī)療設(shè)備清單大全
- 暴雨產(chǎn)流計算(推理公式_四川省)
- NUDD新獨難異失效模式預(yù)防檢查表
評論
0/150
提交評論