




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、基于(jy)MATLAB的信號分析(fnx)與處理實驗共二十三頁共二十三頁共二十三頁共二十三頁Matlab程序(chngx)舉例1:產生時域信號 t=0:0.01:1; x1=0.1*exp(-2*t); %指數信號x2=2*cos(2*pi*4*t); %余弦(yxin)信號x3=ones(1,10) zeros(1,90) ones(1,10) zeros(1,90); %矩形信號subplot(3,1,1); plot(x1); title(指數信號);subplot(3,1,2); plot(x2); title(余弦信號);subplot(3,1,3); plot(x3); titl
2、e(矩形信號);共二十三頁Matlab程序(chngx)舉例2:計算卷積用卷積定理 X1=fft(x1,32); X2=fft(x2,32); Y=X1.*X2; y2=real(ifft(Y); subplot(2,1,1); stem(y1); subplot(2,1,2); stem(y2);直接(zhji)計算 x1=ones(1,5) zeros(1,27) ; x2=ones(1,10) zeros(1,22) ; y1=conv(x1,x2);共二十三頁實驗(shyn)安排1、信號的產生與運算;2、連續與離散(lsn)信號的頻譜分析;3、連續與離散系統分析、濾波;4、信號處理程序
3、設計;(設計性) (卷積、相關、窗函數、DFT、FFT*)5、數字濾波器的設計與濾波;6、wav音頻信號的讀寫與處理。共二十三頁1、信號的產生(chnshng)與運算實驗目的:掌握用Matlab產生基本信號、繪制波形、實現基本運算。實驗指導:實驗教材第一篇之實驗一實驗內容: (1) 常用連續信號的產生與繪圖(hu t); (2) 常用離散信號的產生與繪圖; (3) 離散信號的基本運算(含卷積、相關); (4) 教材實驗內容(P12)之4、5題。(交程序及結果)共二十三頁2、信號(xnho)的頻譜分析實驗目的:掌握用DFT分析離散與連續時間信號頻譜,以及窗函數的波形與頻譜特點。實驗指導:實驗教材
4、第一篇之實驗三、實驗四、實驗五實驗內容: (1) 離散信號的DFT(FFT)變換(binhun)與頻譜圖(P27); (2) 分析5種窗函數的波形圖與頻譜圖(不同窗寬); (3) 連續時間信號的頻譜分析(P33); (4) 教材實驗內容(P34)之4題。共二十三頁3、系統分析與濾波(lb)實驗目的:掌握在已知系統函數或微分(差分)方程時,分析時域響應、頻率響應、系統穩定性的方法。實驗指導:實驗教材第二篇之實驗一、實驗二實驗內容: (1) 連續、離散系統的時域響應與零極點分析; (2) 連續系統的頻率響應特性(幅度(fd)、相位); (3) 離散系統的頻率響應特性(幅度、相位); (4) 教材實
5、驗內容(P58)之4、5題(filter濾波)。共二十三頁4、信號處理(xn ho ch l)程序設計實驗目的:掌握用matlab基本語句實現信號處理的方法,以及自定義函數的編制(binzh)與調用。實驗指導:實驗教材附錄二、數字信號處理教程實驗內容: (1) 根據定義公式編寫程序實現序列卷積、相關運算; (2) 生成與DFT、fftshift同功能的自定義函數; (3) 由表達式生成5種窗信號,用自定義函數分析頻譜; (4) 自己編程實現FFT(選做,參考教材P191)。共二十三頁5、數字(shz)濾波器的設計與濾波實驗目的:掌握用Matlab設計IIR與FIR數字濾波器的方法(fngf),
6、及實現對信號的濾波。實驗指導:實驗教材第二篇之實驗三、實驗四實驗內容: (1) 各種IIR數字濾波器的設計(直接法、原型變換法); (2) 窗口法和頻率抽樣法設計FIR數字濾波器; (3) 用設計結果和filter函數實現信號(mtlb)濾波; (4) 教材實驗內容(P64之2、P72之5題) 。共二十三頁6、wav音頻(ynpn)信號的讀寫與處理實驗目的:掌握聲音信號(xnho)讀寫(wavread、wavwrite)、去噪濾波、限帶濾波及變采樣。實驗指導:實驗教材第三篇之實驗五、實驗七實驗內容: (1) 通過help學習wavread、wavwrite的使用; (2) 實驗七的實驗內容1、
7、2、3(P110); (3) 教材實驗內容(P72之6題); (4) 實驗五的實驗內容2 (P104,存為wav文件)。共二十三頁附:用沖激響應不變法(bin f)、雙線性變換法 設計IIR數字濾波器的具體步驟(1) 按一定規則將給出的數字濾波器的技術指標轉換成模擬低通濾波器的技術指標; (2) 根據轉換后的技術指標使用(shyng)濾波器階數選擇函數,確定最小階數N和固有頻率Wn,根據選用的模擬低通濾波器的類型可分別用函數:buttord, cheb1ord, cheb2ord, ellipord等;(3) 運用最小階數N產生模擬濾波器原型,模擬低通濾波器的創建函數有:buttap, che
8、b1ap, cheb2ap, ellipap等; (4) 運用固有頻率Wn把模擬低通濾波器原型轉換成模擬低通、高通、帶通、帶阻濾波器,可分別用函數lp2lp、lp2hp, lp2bp, lp2bs; (5) 運用沖激響應不變法或雙線性變換法把模擬濾波器轉換成數字濾波器,分別用函數impinvar和bilinear實現。共二十三頁例:Chebyshev I型數字(shz)濾波器設計通帶截止頻率wp,阻帶(z di)截止頻率ws,通帶最大衰減rp,阻帶最小衰減rs. 假設各參數: wp=30*2 *pi; ws=40*2* pi; Fs=100; rp=0.3; rs=80;共二十三頁例1:Che
9、byshev I型數字(shz)濾波器設計選擇階數: N, Wn=cheb1ord(wp, ws, rp, rs, s); 創建Chebyshev I型濾波器原型:z,p,k=cheb1ap(N,rp); 表達形式從零極點增益形式轉換成狀態方程形式: A, B, C, D=zp2ss(z,p,k); 把模擬低通濾波器原型轉換成模擬低通濾波器: At, Bt, Ct, Dt=lp2lp(A, B, C, D, Wn); 表達形式從狀態方程形式轉換成傳遞函數形式: num1 ,den 1=ss2tf(At,Bt,Ct,Dt); 采用沖激響應不變法將模擬濾波器轉換成數字濾波器: num2,den2=
10、impinvar(num1 ,den1, Fs); 返回(fnhu)數字濾波器的頻率響應: H, W=freqz(num2,den2,N)共二十三頁例2:Butterworth數字(shz)濾波器設計N,Wn=buttord(Wp,Ws,Rp,Rs,s); %確定butterworth的最小介數N和頻率參數Wn z,p,k=buttap(N); %設計模擬低通原型的零極點增益參數bp,ap=zp2tf(z,p,k); %將零極點增益轉換成分子分母參數 bs,as=lp2lp(bp,ap,Wn);%將低通原型轉換為模擬低通 bz,az=impinvar(bs,as,Fs); %用脈沖響應不變法進
11、行(jnxng)模數變換 H,W=freqz(bz,az,512,Fs); %生成頻率響應參數 共二十三頁例3:用butter或cheby1函數(hnsh) N,wc=buttord(wp,ws,ap,as,s); bs,as=butter(N,wc, s); %bs,as=cheby1(.); bz,az=impinvar(bs,as,Fs) % bz,az=bilinear(bs,as,Fs) 共二十三頁help cheb1ordCHEB1ORD Chebyshev Type I filter order selection. N, Wn = CHEB1ORD(Wp, Ws, Rp, Rs
12、) returns the order N of the lowest order digital Chebyshev Type I filter that loses no more than Rp dB in the passband and has at least Rs dB of attenuation in the stopband. Wp and Ws are the passband and stopband edge frequencies, normalized from 0 to 1 (where 1 corresponds to pi radians/sample).
13、For example, Lowpass: Wp = .1, Ws = .2 Highpass: Wp = .2, Ws = .1 Bandpass: Wp = .2 .7, Ws = .1 .8 Bandstop: Wp = .1 .8, Ws = .2 .7 CHEB1ORD also returns Wn, the Chebyshev natural frequency to use with CHEBY1 to achieve the specifications. N, Wn = CHEB1ORD(Wp, Ws, Rp, Rs, s) does the computation for
14、 an analog filter, in which case Wp and Ws are in radians/second.共二十三頁help cheby1CHEBY1 Chebyshev Type I digital and analog filter design. B,A = CHEBY1(N,R,Wn) designs an Nth order lowpass digital Chebyshev filter with R decibels of peak-to-peak ripple in the passband. CHEBY1 returns the filter coef
15、ficients in length N+1 vectors B (numerator) and A (denominator). The cutoff frequency Wn must be 0.0 Wn 1.0, with 1.0 corresponding to half the sample rate. Use R=0.5 as a starting point, if you are unsure about choosing R. If Wn is a two-element vector, Wn = W1 W2, CHEBY1 returns an order 2N bandp
16、ass filter with passband W1 W W2. B,A = CHEBY1(N,R,Wn,high) designs a highpass filter. B,A = CHEBY1(N,R,Wn,low) designs a lowpass filter. B,A = CHEBY1(N,R,Wn,stop) is a bandstop filter if Wn = W1 W2. When used with three left-hand arguments, as in Z,P,K = CHEBY1(.), the zeros and poles are returned
17、in length N column vectors Z and P, and the gain in scalar K. When used with four left-hand arguments, as in A,B,C,D = CHEBY1(.), state-space matrices are returned. CHEBY1(N,R,Wn,s), CHEBY1(N,R,Wn,high,s) and CHEBY1(N,R,Wn,stop,s) design analog Chebyshev Type I filters. In this case, Wn is in rad/s
18、and it can be greater than 1.0.共二十三頁help buttordBUTTORD Butterworth filter order selection. N, Wn = BUTTORD(Wp, Ws, Rp, Rs) returns the order N of the lowest order digital Butterworth filter that loses no more than Rp dB in the passband and has at least Rs dB of attenuation in the stopband. Wp and W
19、s are the passband and stopband edge frequencies, normalized from 0 to 1 (where 1 corresponds to pi radians/sample). For example, Lowpass: Wp = .1, Ws = .2 Highpass: Wp = .2, Ws = .1 Bandpass: Wp = .2 .7, Ws = .1 .8 Bandstop: Wp = .1 .8, Ws = .2 .7 BUTTORD also returns Wn, the Butterworth natural fr
20、equency (or, the 3 dB frequency) to use with BUTTER to achieve the specifications. N, Wn = BUTTORD(Wp, Ws, Rp, Rs, s) does the computation for an analog filter, in which case Wp and Ws are in radians/second. When Rp is chosen as 3 dB, the Wn in BUTTER is equal to Wp in BUTTORD. 共二十三頁help butterBUTTE
21、R Butterworth digital and analog filter design. B,A = BUTTER(N,Wn) designs an Nth order lowpass digital Butterworth filter and returns the filter coefficients in length N+1 vectors B (numerator) and A (denominator). The coefficients are listed in descending powers of z. The cutoff frequency Wn must be 0.0 Wn 1.0, with 1.0 corresponding to half the sample rate. If Wn is a two-element vector, Wn = W1 W2, BUTTER returns an order 2N bandpass filter with passband W1 W W2. B,A = BUTTER(N,Wn,high) designs a highpass filter. B,A = BUTTER(N,Wn,low) designs a lowpass filter. B,A = BUTTER(N,Wn,sto
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025合同管理與審批流程詳解
- 2025年契約級生物質能廢水處理系統合同
- 旅游規劃與管理專業綜合測試題
- 2025權益保障借款合同范本匯編
- 2025婚車租賃服務合同范本
- 2025居間代理合同范本
- 2025辦公樓廣告位租賃合同
- 2025年通化貨車資格證考試題
- 2025農行質押貸款合同
- 代持股權轉讓協議
- 2025-2030中國醫療領域的射頻識別設備(RFID)行業市場發展趨勢與前景展望戰略研究報告
- 2025年人教版小學三年級下冊奧林匹克數學競賽測試卷(附參考答案)
- 火鍋店服務員服務全流程詳解
- 2025至2030中國車載OLED屏市場未來前景展望及運行態勢剖析報告
- 2024-2025學年八年級下學期道德與法治期中模擬試卷(二)(統編版含答案解析)
- 2025-2030中國生物醫藥行業市場深度調研及發展趨勢與投資前景預測研究報告
- 貿易公司員工管理制度
- 專利代理師高頻題庫新版2025
- 肝硬化護理新進展
- 武安市公安局招聘警務輔助人員筆試真題2024
- 2025年全國國家版圖知識競賽題庫及答案(中小學組)
評論
0/150
提交評論