




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、1實(shí)驗(yàn)二實(shí)驗(yàn)二信號的頻譜分析信號的頻譜分析2系統(tǒng)仿真的要點(diǎn) 關(guān)于快速傅立葉變換的關(guān)于快速傅立葉變換的fft函數(shù)的函數(shù)的調(diào)用調(diào)用 頻譜分析舉例頻譜分析舉例3一一、fft函數(shù)的調(diào)用函數(shù)的調(diào)用 fft(x)DFT的的快速算法快速算法 (1) 數(shù)據(jù)長度為數(shù)據(jù)長度為N; 若若N為為2的整數(shù)次冪,則是基的整數(shù)次冪,則是基-2的的 DFT,運(yùn)算速度較快;,運(yùn)算速度較快; 若若N不為不為2的整數(shù)次冪,則運(yùn)算速的整數(shù)次冪,則運(yùn)算速 度較慢。度較慢。 (2)若數(shù)據(jù)實(shí)際長度小于)若數(shù)據(jù)實(shí)際長度小于N,則自動補(bǔ),則自動補(bǔ) 一些零,使之長度等于一些零,使之長度等于N.4 復(fù)指數(shù)座標(biāo)復(fù)指數(shù)座標(biāo) 正變換正變換 反變換反變換
2、 其中其中NnnkNWnxkX1) 1() 1(NnnkNWkXnx1) 1() 1(NjNeW25 fft(x) 或或fft(x,N)的調(diào)用編程的調(diào)用編程00.10.20.30.40.50.60.70.80.91-20-1001020304050t=(0:1/255:1);x=exp(-0.9)*sin(2*pi*60*t);y=fft(x);ry=real(y);a=abs(y);plot(t,ry,r-,t,a,b-);grid這里是歸一化頻率6利用fft計算功率譜的函數(shù)演示fftdemo(1)產(chǎn)生信號)產(chǎn)生信號(2)調(diào)用函數(shù)計算頻率特性)調(diào)用函數(shù)計算頻率特性(fft)(3)計算功率譜)
3、計算功率譜(Pyy)(4)顯示結(jié)果)顯示結(jié)果7(1)(1)產(chǎn)生信號產(chǎn)生信號 運(yùn)行軟件Matlab, 進(jìn)入Matlab Comand Windows 運(yùn)行運(yùn)行fftdemo命令,該程序是按照一步命令,該程序是按照一步一步的斷點(diǎn)執(zhí)行的,它能一邊顯示注解,一步的斷點(diǎn)執(zhí)行的,它能一邊顯示注解,一邊給出每一步的結(jié)果,所以我們根據(jù)一邊給出每一步的結(jié)果,所以我們根據(jù)這個演示,能學(xué)會這個演示,能學(xué)會fft函數(shù)的調(diào)函數(shù)的調(diào) 用及其有關(guān)應(yīng)用技巧。用及其有關(guān)應(yīng)用技巧。8 To get started, type one of these commands: helpwin, helpdesk, or demo. F
4、or information on all of the MathWorks products, type tour. ?fftdemoclc% This example shows the use of the FFT function for spectral % analysis. A common use of FFTs is to find the frequency% components of a signal buried in a noisy time domain signal.%9 要求產(chǎn)生一個時間從0到250毫秒的,含有噪聲的,頻率為50到120Hzde 時域信號, 噪
5、聲的標(biāo)準(zhǔn)差為2。離散信號的時間間隔為1毫秒。 程序如下:t = 0:.001:.25;x = sin(2*pi*50*t) + sin(2*pi*120*t);y = x + 2*randn(size(t);plot(y(1:50), title(Noisy time domain signal), 10% First we need to create some data. Consider data sampled at% 1000 Hz. We start by forming a time axis for our data, running% from t=0 until t=.25
6、 in steps of 1 millisecond:t = 0:.001:.25;pause % Strike any key to continue.11pause % Strike any key to continue.% Next we can form a signal containing 50 Hz and 120 Hz:x = sin(2*pi*50*t) + sin(2*pi*120*t);pause % Strike any key to continue.12% and add some random noise with a standard deviation of
7、 2 to % produce a noisy signal y:y = x + 2*randn(size(t);pause % Strike any key to continue.plot(y(1:50), title(Noisy time domain signal), pause0204060-505Noisy time domain signal13(2)函數(shù)調(diào)用計算頻率特性)函數(shù)調(diào)用計算頻率特性計算計算功率譜以及顯示結(jié)果功率譜以及顯示結(jié)果 Y = fft(y,256); Pyy = Y.*conj(Y)/256; f = 1000/256*(0:127); plot(f,Pyy(1
8、:128), title(Power spectral density), .繪制頻譜之前先設(shè)定頻率軸NYYPyy/*只繪出前128點(diǎn)另一半對折14clc% Clearly, it is difficult to identify the frequency components% from looking at the original signal; thats why spectral analysis% is so popular.% Finding the discrete Fourier transform of the noisy signal y% is easy; we ju
9、st take the fast-Fourier transform (FFT) :Y = fft(y,256);pause % Strike any key to continue.15% The power spectral density, a measurement of the energy at% various frequencies, is found with:Pyy = Y.*conj(Y)/256;pause % Strike any key to continue.計算功率譜計算功率譜(Pyy)計算頻率軸計算頻率軸16Y=;y=;clc% To plot the pow
10、er spectral density, we must first form a % frequency axis:f = 1000/256*(0:127);% which we do for the first 127 points. (The remainder of the 256% points are symmetric.) We can now plot the power spectral% density:pause % Strike any key for plot.17plot(f,Pyy(1:128), title(Power spectral density), .0
11、200400600020406080Power spectral densityFrequency (Hz)(4)顯示結(jié)果)顯示結(jié)果18ZOOM plot(f(1:50),Pyy(1:50), title(Power spectral density), . echo off End 以上程序是Matlab 提供的fftdemo演示舉例,同學(xué)們跟著它執(zhí)行一遍,有助于理解和掌握。利用zoom把感興趣的部分放大顯示19% Lets zoom in and plot only up to 200 Hz:pause % Strike any key for plot.plot(f(1:50),Pyy(1:50), title(P
溫馨提示
- 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- T-ZHAQ 6-2024 帶逆變輸出的儲能電源
- 醫(yī)院與醫(yī)學(xué)檢驗(yàn)技術(shù)人員2025年度勞動合同
- 二零二五年度股權(quán)質(zhì)押與企業(yè)債務(wù)重組合同
- 二零二五年度集體宿舍租賃與社區(qū)治理服務(wù)合同
- 全面履行原則在2025年度房地產(chǎn)項(xiàng)目開發(fā)合同中的執(zhí)行要求
- 二零二五年度汽車運(yùn)輸安全責(zé)任保險合作協(xié)議
- 二零二五年度文化展覽聘請藝術(shù)藝人演出合同
- 2025年度高科技研發(fā)項(xiàng)目投資債轉(zhuǎn)股協(xié)議書
- 2025年度新能源汽車產(chǎn)業(yè)鏈債權(quán)轉(zhuǎn)讓合同
- 二零二五年度電子元器件制造勞務(wù)派遣員工合同
- 2025年極兔速遞有限公司招聘筆試參考題庫含答案解析
- 躁狂的健康宣教
- 2025年浙江省水務(wù)集團(tuán)招聘筆試參考題庫含答案解析
- 四川省成都市2025屆高三一診考試英語試卷含解析
- 飛機(jī)空氣動力學(xué)課件:翼型的空氣動力特性
- 公司綠色可持續(xù)發(fā)展規(guī)劃報告
- 機(jī)械制造工藝與裝備 習(xí)題及答案 葉文華 ch01 -ch09
- 征信培訓(xùn)課件
- 遼寧省營口市2024-2025學(xué)年七年級上學(xué)期期中語文試題
- 《畫垂線和平行線》(教案)2023-2024學(xué)年數(shù)學(xué)四年級上冊
- GB/T 44770-2024智能火電廠技術(shù)要求
評論
0/150
提交評論