信號(hào)分析與處理實(shí)驗(yàn)(MATLAB)資料_第1頁
信號(hào)分析與處理實(shí)驗(yàn)(MATLAB)資料_第2頁
信號(hào)分析與處理實(shí)驗(yàn)(MATLAB)資料_第3頁
信號(hào)分析與處理實(shí)驗(yàn)(MATLAB)資料_第4頁
信號(hào)分析與處理實(shí)驗(yàn)(MATLAB)資料_第5頁
已閱讀5頁,還剩18頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、基于(jy)MATLAB的信號(hào)分析(fnx)與處理實(shí)驗(yàn)共二十三頁共二十三頁共二十三頁共二十三頁Matlab程序(chngx)舉例1:產(chǎn)生時(shí)域信號(hào) t=0:0.01:1; x1=0.1*exp(-2*t); %指數(shù)信號(hào)x2=2*cos(2*pi*4*t); %余弦(yxin)信號(hào)x3=ones(1,10) zeros(1,90) ones(1,10) zeros(1,90); %矩形信號(hào)subplot(3,1,1); plot(x1); title(指數(shù)信號(hào));subplot(3,1,2); plot(x2); title(余弦信號(hào));subplot(3,1,3); plot(x3); titl

2、e(矩形信號(hào));共二十三頁Matlab程序(chngx)舉例2:計(jì)算卷積用卷積定理 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)計(jì)算 x1=ones(1,5) zeros(1,27) ; x2=ones(1,10) zeros(1,22) ; y1=conv(x1,x2);共二十三頁實(shí)驗(yàn)(shyn)安排1、信號(hào)的產(chǎn)生與運(yùn)算;2、連續(xù)與離散(lsn)信號(hào)的頻譜分析;3、連續(xù)與離散系統(tǒng)分析、濾波;4、信號(hào)處理程序

3、設(shè)計(jì);(設(shè)計(jì)性) (卷積、相關(guān)、窗函數(shù)、DFT、FFT*)5、數(shù)字濾波器的設(shè)計(jì)與濾波;6、wav音頻信號(hào)的讀寫與處理。共二十三頁1、信號(hào)的產(chǎn)生(chnshng)與運(yùn)算實(shí)驗(yàn)?zāi)康模赫莆沼肕atlab產(chǎn)生基本信號(hào)、繪制波形、實(shí)現(xiàn)基本運(yùn)算。實(shí)驗(yàn)指導(dǎo):實(shí)驗(yàn)教材第一篇之實(shí)驗(yàn)一實(shí)驗(yàn)內(nèi)容: (1) 常用連續(xù)信號(hào)的產(chǎn)生與繪圖(hu t); (2) 常用離散信號(hào)的產(chǎn)生與繪圖; (3) 離散信號(hào)的基本運(yùn)算(含卷積、相關(guān)); (4) 教材實(shí)驗(yàn)內(nèi)容(P12)之4、5題。(交程序及結(jié)果)共二十三頁2、信號(hào)(xnho)的頻譜分析實(shí)驗(yàn)?zāi)康模赫莆沼肈FT分析離散與連續(xù)時(shí)間信號(hào)頻譜,以及窗函數(shù)的波形與頻譜特點(diǎn)。實(shí)驗(yàn)指導(dǎo):實(shí)驗(yàn)教材

4、第一篇之實(shí)驗(yàn)三、實(shí)驗(yàn)四、實(shí)驗(yàn)五實(shí)驗(yàn)內(nèi)容: (1) 離散信號(hào)的DFT(FFT)變換(binhun)與頻譜圖(P27); (2) 分析5種窗函數(shù)的波形圖與頻譜圖(不同窗寬); (3) 連續(xù)時(shí)間信號(hào)的頻譜分析(P33); (4) 教材實(shí)驗(yàn)內(nèi)容(P34)之4題。共二十三頁3、系統(tǒng)分析與濾波(lb)實(shí)驗(yàn)?zāi)康模赫莆赵谝阎到y(tǒng)函數(shù)或微分(差分)方程時(shí),分析時(shí)域響應(yīng)、頻率響應(yīng)、系統(tǒng)穩(wěn)定性的方法。實(shí)驗(yàn)指導(dǎo):實(shí)驗(yàn)教材第二篇之實(shí)驗(yàn)一、實(shí)驗(yàn)二實(shí)驗(yàn)內(nèi)容: (1) 連續(xù)、離散系統(tǒng)的時(shí)域響應(yīng)與零極點(diǎn)分析; (2) 連續(xù)系統(tǒng)的頻率響應(yīng)特性(幅度(fd)、相位); (3) 離散系統(tǒng)的頻率響應(yīng)特性(幅度、相位); (4) 教材實(shí)

5、驗(yàn)內(nèi)容(P58)之4、5題(filter濾波)。共二十三頁4、信號(hào)處理(xn ho ch l)程序設(shè)計(jì)實(shí)驗(yàn)?zāi)康模赫莆沼胢atlab基本語句實(shí)現(xiàn)信號(hào)處理的方法,以及自定義函數(shù)的編制(binzh)與調(diào)用。實(shí)驗(yàn)指導(dǎo):實(shí)驗(yàn)教材附錄二、數(shù)字信號(hào)處理教程實(shí)驗(yàn)內(nèi)容: (1) 根據(jù)定義公式編寫程序?qū)崿F(xiàn)序列卷積、相關(guān)運(yùn)算; (2) 生成與DFT、fftshift同功能的自定義函數(shù); (3) 由表達(dá)式生成5種窗信號(hào),用自定義函數(shù)分析頻譜; (4) 自己編程實(shí)現(xiàn)FFT(選做,參考教材P191)。共二十三頁5、數(shù)字(shz)濾波器的設(shè)計(jì)與濾波實(shí)驗(yàn)?zāi)康模赫莆沼肕atlab設(shè)計(jì)IIR與FIR數(shù)字濾波器的方法(fngf),

6、及實(shí)現(xiàn)對(duì)信號(hào)的濾波。實(shí)驗(yàn)指導(dǎo):實(shí)驗(yàn)教材第二篇之實(shí)驗(yàn)三、實(shí)驗(yàn)四實(shí)驗(yàn)內(nèi)容: (1) 各種IIR數(shù)字濾波器的設(shè)計(jì)(直接法、原型變換法); (2) 窗口法和頻率抽樣法設(shè)計(jì)FIR數(shù)字濾波器; (3) 用設(shè)計(jì)結(jié)果和filter函數(shù)實(shí)現(xiàn)信號(hào)(mtlb)濾波; (4) 教材實(shí)驗(yàn)內(nèi)容(P64之2、P72之5題) 。共二十三頁6、wav音頻(ynpn)信號(hào)的讀寫與處理實(shí)驗(yàn)?zāi)康模赫莆章曇粜盘?hào)(xnho)讀寫(wavread、wavwrite)、去噪濾波、限帶濾波及變采樣。實(shí)驗(yàn)指導(dǎo):實(shí)驗(yàn)教材第三篇之實(shí)驗(yàn)五、實(shí)驗(yàn)七實(shí)驗(yàn)內(nèi)容: (1) 通過help學(xué)習(xí)wavread、wavwrite的使用; (2) 實(shí)驗(yàn)七的實(shí)驗(yàn)內(nèi)容1、

7、2、3(P110); (3) 教材實(shí)驗(yàn)內(nèi)容(P72之6題); (4) 實(shí)驗(yàn)五的實(shí)驗(yàn)內(nèi)容2 (P104,存為wav文件)。共二十三頁附:用沖激響應(yīng)不變法(bin f)、雙線性變換法 設(shè)計(jì)IIR數(shù)字濾波器的具體步驟(1) 按一定規(guī)則將給出的數(shù)字濾波器的技術(shù)指標(biāo)轉(zhuǎn)換成模擬低通濾波器的技術(shù)指標(biāo); (2) 根據(jù)轉(zhuǎn)換后的技術(shù)指標(biāo)使用(shyng)濾波器階數(shù)選擇函數(shù),確定最小階數(shù)N和固有頻率Wn,根據(jù)選用的模擬低通濾波器的類型可分別用函數(shù):buttord, cheb1ord, cheb2ord, ellipord等;(3) 運(yùn)用最小階數(shù)N產(chǎn)生模擬濾波器原型,模擬低通濾波器的創(chuàng)建函數(shù)有:buttap, che

8、b1ap, cheb2ap, ellipap等; (4) 運(yùn)用固有頻率Wn把模擬低通濾波器原型轉(zhuǎn)換成模擬低通、高通、帶通、帶阻濾波器,可分別用函數(shù)lp2lp、lp2hp, lp2bp, lp2bs; (5) 運(yùn)用沖激響應(yīng)不變法或雙線性變換法把模擬濾波器轉(zhuǎn)換成數(shù)字濾波器,分別用函數(shù)impinvar和bilinear實(shí)現(xiàn)。共二十三頁例:Chebyshev I型數(shù)字(shz)濾波器設(shè)計(jì)通帶截止頻率wp,阻帶(z di)截止頻率ws,通帶最大衰減rp,阻帶最小衰減rs. 假設(shè)各參數(shù): wp=30*2 *pi; ws=40*2* pi; Fs=100; rp=0.3; rs=80;共二十三頁例1:Che

9、byshev I型數(shù)字(shz)濾波器設(shè)計(jì)選擇階數(shù): N, Wn=cheb1ord(wp, ws, rp, rs, s); 創(chuàng)建Chebyshev I型濾波器原型:z,p,k=cheb1ap(N,rp); 表達(dá)形式從零極點(diǎn)增益形式轉(zhuǎn)換成狀態(tài)方程形式: A, B, C, D=zp2ss(z,p,k); 把模擬低通濾波器原型轉(zhuǎn)換成模擬低通濾波器: At, Bt, Ct, Dt=lp2lp(A, B, C, D, Wn); 表達(dá)形式從狀態(tài)方程形式轉(zhuǎn)換成傳遞函數(shù)形式: num1 ,den 1=ss2tf(At,Bt,Ct,Dt); 采用沖激響應(yīng)不變法將模擬濾波器轉(zhuǎn)換成數(shù)字濾波器: num2,den2=

10、impinvar(num1 ,den1, Fs); 返回(fnhu)數(shù)字濾波器的頻率響應(yīng): H, W=freqz(num2,den2,N)共二十三頁例2:Butterworth數(shù)字(shz)濾波器設(shè)計(jì)N,Wn=buttord(Wp,Ws,Rp,Rs,s); %確定butterworth的最小介數(shù)N和頻率參數(shù)Wn z,p,k=buttap(N); %設(shè)計(jì)模擬低通原型的零極點(diǎn)增益參數(shù)bp,ap=zp2tf(z,p,k); %將零極點(diǎn)增益轉(zhuǎn)換成分子分母參數(shù) bs,as=lp2lp(bp,ap,Wn);%將低通原型轉(zhuǎn)換為模擬低通 bz,az=impinvar(bs,as,Fs); %用脈沖響應(yīng)不變法進(jìn)

11、行(jnxng)模數(shù)變換 H,W=freqz(bz,az,512,Fs); %生成頻率響應(yīng)參數(shù) 共二十三頁例3:用butter或cheby1函數(shù)(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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論