【正文】
??? ddg ?? MATLAB 信號(hào)處理工具箱提供計(jì)算群延遲函數(shù) grpdelay,調(diào)用格式為: [gd,w]=grpdelay(b,a,n[,’whole’]) [gd,f]=grpdelay(b,a,n[,’whole’],Fs) gd=grpdelay(b,a,w) gd=grpdelay(b,a,f,Fs) grpdelay 其中, gd 為群延遲;其他各項(xiàng)意義同函數(shù) freqz,函數(shù)輸出項(xiàng)缺省時(shí),繪制群延遲圖。調(diào)用格式為: [[h,t]=]impz(b,a[,n,Fs]) 式中, b,a 分別為濾波器分子和分母多項(xiàng)式系數(shù)向量; n 為采樣點(diǎn)數(shù); Fs 為采樣頻率,缺省值為 1; h為濾波器單位脈沖響應(yīng)向量; t 為和 h對(duì)應(yīng)的時(shí)間向量。 式中, b,a 為數(shù)字濾波器分子和分母多項(xiàng)式的系數(shù), n為復(fù)數(shù)頻率的響應(yīng)點(diǎn)數(shù),為整數(shù),最好為 2 的冪,缺省時(shí)為 512; Fs 為采樣頻率,單位 Hz。 s 域和 z域?qū)?yīng)關(guān)系也簡(jiǎn)單。其調(diào)用方式為: [zd,pd,kd]=bilinear(z,p,k,Fs) [numd,dend]=bilinear(num,den,Fs) 式中, z,p 分別為模擬濾波器零點(diǎn)、極點(diǎn)列向量; k為模擬濾波器的增益; Fs為采樣頻率,單位 Hz。如果模擬濾波器頻率響應(yīng)是有限帶寬的話,通過(guò)變換得到的數(shù)字濾波器的頻率響應(yīng)非常接近于模擬濾波器的頻率響應(yīng)。下面我們用例 第 9 頁(yè) 子說(shuō)明如何使用這個(gè)函數(shù)。 若調(diào)用 residue 函數(shù)的形式為 [R,P,K]=residue(a,b) 形式,則將下式(傳遞函數(shù)形式): )1()()2()1( )1()()2()1()( )()( 11????? ??????? ??naasnaasasa nbbsnbbsbsbsa sbsH nanbnbnba ?? 變換為: )1()2()1()( 11 ??????? ??? MKsKsKps RsH MMNk kka ? 這種形式為極點(diǎn)留數(shù)商向量形式,對(duì)于本節(jié)所講的特定情況, K 為空矩陣。 所謂脈沖響應(yīng)不變法就是使數(shù)字濾波器的脈沖響應(yīng)序列 h(n)等于模擬濾波器的脈沖響應(yīng) ha(t)的采樣值,即 ? ? ? ?nThthnhanTta ?? ?)( 式中, T 為采樣周期。 (3) 按頻率通帶范圍分類 第 7 頁(yè) 按頻率通帶范圍分類,濾波器可分為低通、高通、帶通、帶阻、全通五個(gè)類別。在實(shí)際中,利用式 (1)來(lái)計(jì)算 IIR 濾波器的輸出是不可行的,因?yàn)樗臎_擊響應(yīng)的長(zhǎng)度太長(zhǎng)(理論上是無(wú)窮大的)。 時(shí)域離散系統(tǒng)的頻域特性 : ,其中 、 分別是數(shù)字濾波器的輸出序列和輸入序列的頻域特性(或稱為頻譜特性) , 是數(shù)字濾波器的單位取樣響應(yīng)的頻譜,又稱為數(shù)字濾波器的頻域響應(yīng)。這樣,數(shù)字濾波器的分析與設(shè)計(jì)的內(nèi)容也更加豐富起來(lái),各種新的數(shù)字信號(hào)處理系統(tǒng),也都能用專用數(shù)字硬件實(shí)時(shí)加以實(shí)現(xiàn)。關(guān)于數(shù)字濾波器,早在上世紀(jì) 40 年代末期,就有人討論過(guò)它的可能性問(wèn)題,但直到 60 年代中期,才開始形成關(guān)于數(shù)字濾波器的一整套完整的正規(guī)理論。遞歸濾波器 的階數(shù)越高,舍入噪聲的累計(jì)就越大,可能會(huì)引起濾波器的不穩(wěn)定。 (8) 數(shù)字濾波器可以以極低的頻率運(yùn)行,例如在生物醫(yī)學(xué)中有許多極低頻率應(yīng)用的例子,在這些應(yīng)用中采用模擬濾波器是不現(xiàn)實(shí)的。 (3) 如果利用一個(gè)可編程的處理器來(lái)實(shí)現(xiàn),那么數(shù)字濾波器的頻率響應(yīng)就能被自動(dòng)地調(diào)整。他 以矩陣運(yùn)算為基礎(chǔ),把計(jì)算、可視化、程序設(shè)計(jì)融合到了一個(gè)交互式的工作環(huán)境中。自 60 年代起由于計(jì)算機(jī)技術(shù)、集成工藝和材料工業(yè)的發(fā)展,濾波器發(fā)展上了一個(gè)新臺(tái)階,并且朝著低功耗、高精度、小體積、多功能、穩(wěn)定可靠和價(jià)廉方向努力,其中小體積、多功能、高精度、穩(wěn)定可靠成為 70 年代以后的主攻方向。s extensive concern, its theory and the algorithm is along with the puter technology and microelectronics technology development have developed rapidly, is widely used in speech image processing, digital munications, spectrum analysis, pattern recognition, automatic control, etc. Digital filter is digital signal processing in one of the most important part, almost appear in all of digital signal processing system. Digital filter is the voice and image processing and pattern recognition, spectral analysis of the application of such as a basic processing algorithms, in digital signal processing, occupies an extremely important role. Digital filter is digital signal processing in one of the most important part. In this paper, the design of the digital filter IIR thought, this paper introduces the process of MATLAB, the popularization and application of the digital filter is of certain stimulative effect. The base course design will finish digital chebyshev a, chebyshev 2 and bart wo bandpass IIR the design of filter, the linear transformation and the infinite impulse response IIR principle plete design, and use of MATLAB simulation, and in the programming on DSP. Keywords: Digital filters, IIR, MATLAB, CCS 目 錄 1 緒論 .......................................................................................................................... 1 IIR 數(shù)字濾波器 選題意義 .................................................................................... 2 數(shù)字濾波器的發(fā)展及前景 ............................................................................. 3 2 數(shù) 字濾波器基本理論 .............................................................................................. 5 數(shù)字濾波器 概念 ................................................................................................. 5 數(shù)字濾波器的類型 .............................................................................................. 6 濾波器的設(shè)計(jì) ...................................................................................................... 6 濾波器的設(shè)計(jì)步驟 .............................................................................................. 7 脈沖響應(yīng)不變法 .................................................................................................. 7 雙線性變換法 ...................................................................................................... 9 濾波器的特性及使用函數(shù) ................................................................................ 11 3 DSP芯片概述 ....................................................................................................... 13 芯片定義 ................................................................................................... 13 芯片主要特點(diǎn) ........................................................................................... 13 芯片的優(yōu)缺點(diǎn) ........................................................................................... 13 芯片的選擇 ............................................................................................... 15 系統(tǒng)構(gòu) 成 ................................................................................................... 16 4數(shù)字濾波器的實(shí)現(xiàn) ................................................................................................... 17 在 MATLAB 上做算法仿真 .............................................................................. 17 在 DSP 上編程實(shí)現(xiàn) ........................................................................................... 25 編程心得 .......................................................................................................... 27 編程思想 ............................................................................................................ 27 5 結(jié)論 .......................................................................................................................... 28 致 謝 .......................................................................................................................... 29 參考文獻(xiàn) ...................................................................................................................... 30 附錄 ..