FFT spectrum analyzer数字信号处理第二次大作业.docx

上传人:b****0 文档编号:17391159 上传时间:2023-07-24 格式:DOCX 页数:15 大小:549.89KB
下载 相关 举报
FFT spectrum analyzer数字信号处理第二次大作业.docx_第1页
第1页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第2页
第2页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第3页
第3页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第4页
第4页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第5页
第5页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第6页
第6页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第7页
第7页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第8页
第8页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第9页
第9页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第10页
第10页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第11页
第11页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第12页
第12页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第13页
第13页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第14页
第14页 / 共15页
FFT spectrum analyzer数字信号处理第二次大作业.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

FFT spectrum analyzer数字信号处理第二次大作业.docx

《FFT spectrum analyzer数字信号处理第二次大作业.docx》由会员分享,可在线阅读,更多相关《FFT spectrum analyzer数字信号处理第二次大作业.docx(15页珍藏版)》请在冰点文库上搜索。

FFT spectrum analyzer数字信号处理第二次大作业.docx

FFTspectrumanalyzer数字信号处理第二次大作业

 

 

FFTspectrumanalyzer

basedonMatlab

 

NAME

XXXXX

StudentID

00000000000

Professor

何岭松

Date

2013-10-08

Abstract

Fouriertransformispowerfulmethodinsignalprocess.Itcantransformthesignalfromtimedomaintofrequencydomain.Infrequencydomainsomecharacteristicismoreobviousthanitintimedomain.Forthediscretesignal,thereisDiscreteFourierTransform(DFT).ButtheamountofcalculationinDFTislarge,tospeedupincalculation,thereisFastFourierTransform(FFT).ForDFTandFFT,asthespectrumisdiscrete,andonlythefrequencysamplingpointiscalculated,itcausedthefenceeffect.Andtheenergyleakageforcycleextension.Toreducethefenceeffect,windowfunctionisneeded.

Inthisproject,FFTisusedtoanalyzethespectrumofthesignal.Thesignalcanbegeneratedinthreeways,signalgenerator,readfromwavfilesandinputfromthesoundcard.Toreducethefenceeffect,windowfunctionissupported.

 

Keywords:

FFTwavfilesoundcardinputwindowfunction

Content

1.Introduction1

2.Method2

2.1Signalspectrumanalysis2

2.1.1ContinuousFourierTransform2

2.1.2DiscreteFourierTransform(DFT)2

2.1.3FastFourierTransform(FFT)3

2.2WindowFunction3

2.3SignalSource4

2.4Zoomspectrum5

3.Results5

3.1Interfaceoftheprogram5

3.2FFTthesignalfromsignalgenerator7

3.3Readthewavfileandspectrumanalysis9

3.4Soundcardinputandspectrumanalysis10

3.5ZoomFFT10

3.6Windowfunction10

4.Conclusions13

5.References13

 

1.Introduction

Oneofthemostcommonlyusedmethodinsignalprocessingisthespectrumanalysis.Ittransformthesignalfromtimedomaintofrequencydomain.Forsomesignal,thetimedomainanalysisisverydifficult,andsomecharacteristicsishardtoobtainfromtimedomainanalysis,suchasifthesignalhasacycle,thecompositionofthesignal.Thosecharacteristicsisveryclearinfrequencydomain.

ThemethodthattransformthesignalfromtimedomainintofrequencydomainisFourierTransform.Forthecontinuoussignal,integrationiscalculated.Forthediscretesignal,thereistheDiscreteFourierTransform(DFT).Thesummationisinsteadtheintegration.Asthesummationislargecalculation,especiallywhenthesamplepointislarge.AgoodwaytospeedupthecalculationistheFastFourierTransform(FFT).FFTismuchfastertheDFT,especiallywhenthesamplepointislarge.Forexample,forasignalof1024points,theFFTisfasterthantheDFT100times.

Generally,thesignaliscontinuous,whenwegetthesignal,wediscretethesignalwithasamplesignal.ForDFTorFFT,wediscretethespectrum,andonlycalculatethefrequencysamplingpoints.Thefrequencythatwedon’tsampledisignored,whichcausedtheFenceEffect.Forthesignalislongintime,it’snotpossibletosamplethewholesignal.Infact,onlyasectionofthesignalissampled,andthenextendthesignalwiththecycleassampled.Thesignalofcycleextensionisdifferentwiththeoriginal.Thiscausedtheenergyleakage.Toreducethefenceeffect,windowfunctionisused.Inthisproject5windowfunctionissupported,theyarerectanglewindow,trianglewindow,hanningwindow,hammingwindowandblackmanwindow.Usercanselectdifferentwindowfunctionbyagroupofradiobutton.

TheresultofDFTorFFTisgivingthewholespectrum.Insomecase,wejustinterestonalittlerangeofthespectrum.Forthiscase,zoomtechniquesofthespectrumisneeded.Inthisproject,it’sincluded.

Inthisproject,thesourcesignalthattobeanalyzeisgeneratedinthreeways,signalgenerator,readfromwavfileandrecordfromsoundcard.

2.Method

2.1Signalspectrumanalysis

Thespectrumanalysisisoneofthemostcommonlymethodinsignalprocessing.Forsomecharacteristicofthesignalistimedomainisnoteasytoget,ittransformthesignaloftimedomainintofrequencydomain,andanalyzethesignalinfrequencydomain.

2.1.1ContinuousFourierTransform

Forthecontinuoussignal,theFouriertransformisshowas

isthesignalintimedomain.

isthesignalinfrequencydomain.Forthesignaliscontinuous,tocalculatetheformofthesignalinfrequencyintegrationisneeded.

2.1.2DiscreteFourierTransform(DFT)

Asdigitalsignalisnotcontinuousbutdiscrete.It’simpossibletocalculateallfrequencypoints.Tocalculatethespectrum

it’sfirsttodiscretethefrequency:

Nisthesizeofsamplepoint,andFsisthesamplefrequency.Then,thefrequencypointis

Finally,thespectrumofthesignalis

k=0,1,2,...,N-1

Where,Nisthesizeofsamplepoint,

2.1.3FastFourierTransform(FFT)

From2.1.2,wefindthatDFTcancalculatetheX(f),butifweextendit,wegetthis.

Where

Fromthis,wecanfindthatalargecalculationsofsineandcosinearerepeat.Ifwereducetheserepeatcalculation,itwillbemuchfaster.That’swhatFFThasdone.Asit’sname,FFTisfasterthanDFT,thelargerthepointsare,thefastertheFFTiscomparedwithDFT.Forasignalof1024points,theFFTis100timesfasterthenDFT.

2.2WindowFunction

AsDFTandFFT,spectrumisdiscrete,andonlycalculatethefrequencysamplingpoint,andotherpointisnot.SoFenceeffectiscaused,andsomeinformationofthespectrumismissed.

Thesignalintimedomainislong,evensomeareendless.It’simpossibletosampleallthesignal.Infact,thecommonmethodissampleasectionasacycleofthesignal,andthenextendthesignal.Asthesignalofcycleextensionisdifferentwiththeoriginalsignal,Energyleakageiscaused.Fromthemathematicalpointofview,thisprocesscanbedescribedas

x(t):

Originalsignal.

w(t):

Cutoffwindowfunction

y(t):

Extensionsignal.

Theenergyleakageisnotalwaysbadforanalysis.Itreducedthefenceeffect,especiallywhenaappropriatewindowfunctionw(t)ischosen.

Thereare5windowfunctionissupportedinthisproject,theyareRectangleWindow,TriangleWindow,HanningWindow,HammingWindowandBlackmanWindow.Themathematicexpressionofthewindowfunctionsarelistintable1.

Table1themathematicexpressionandtheAmplitudecorrectioncoefficient.

Windowfunction

Mathematicexpression

Amplitudecorrectioncoefficient

Rectanglewindow

1

Hanningwindow

2

Hammingwindow

1.852

Trianglewindow

2

Blackmanwindow

2.381

2.3SignalSource

Inthisprojectthesignalgeneratedinthreeways.ThefirstisfromthesignalgeneratorbasedonMatlab,thesecondisreadfromwavfilesandthethirdisfromcomputer’ssoundcard.

Forthesignalgenerator,theprogramsupport4types,sine,cosine,squareandtrianglewave.Theexpressionofthewaveislistintable2.

Table2theexpressionofthesignal

Signaltype

Mathematicexpression

Sinewave

Cosinewave

Squarewave

Trianglewave

InMatlab,therefunctionstoreadsignalfromwavfileandrecordfromthesoundcard.Thefunctiontoreadwavfileis

[Y,Fs,NBITS]=wavread(FILE);

Yisthedatareadfromthewavfile,Fsisthesamplerate,andNBITSisthenumberofbitspersampleusedtoencodethedatainthefile.

2.4Zoomspectrum

ForthenormalFFT,itshowsallthefrequency.Sometimes,thecharacteristicsfocusedonlyinasmallrangeinfrequency.FromthespectrumfromthenormalFFT,it’snotconvenienttoobservethesignal.Thus,zoomspectrumisneeded.

Intheproject,atfirstwemakethesignalaZtransform,andthenanalyzethesignal.Sothespectrumisintherangethatweinterestedin.

3.Results

3.1Interfaceoftheprogram

Thefinalinterfaceoftheprogramisshowinfig.3.1

Fig.3.1thefinalinterfaceoftheprogram

Asshowninfig.3.1,theinterfacedivide6parts.Thefirstpartistwoaxes.Theyshowthesignalintimedomainandfrequencydomainrespectively.

Thesecondpartisthewindowfunctionselectionpart.Inthispart,fivewindowfunctionaresupported.TheyareRectanglewindow,Trianglewindow,Hanningwindow,HammingwindowandBlackmanwindow.Thispartisshowninfig.3.2.

Thethirdpartisthesignalgenerator.Itsimilarwithproject1.It’snomoredetaildiscussedhere.It’sshowninfig.3.3

Fig3.2windowfunctionselectionfig.3.3signalgenerator

Theforthpartisthereadwavfilepart.Fromthepushbuttonselectwavfileusercanselectthewavfile.Theretwoedittextboxinthispart,withwhichtheusercansetthesamplesection.Thispartisshowninfig3.4.

Thefifthpartistherecordpart.Withthispart,theusercaninputthesoundfromthecomputer’ssoundcard.Thereare4parametersshouldbeset,theyaresamplepoint,sampleFrequency,channelofthesoundandthenumberofthedatatoencode.It’sshowinfig3.5

Thesixthpartisfrequencyspectrumrefinement.Withthispart,usercanzoomtheinterestedfrequencyrange.Thispartisshowninfig3.6

Fig3.4wavfilereadpartfig3.5soundcardinputpart

Fig3.6Frequencyspectrumrefinementpart

3.2FFTthesignalfromsignalgenerator

Thesignalthatsignalgeneratorgeneratedisthestandardsignal.Theyaresinewave,cosinewave,squarewaveandtrianglewave.Thetimeandfrequencydomainwaveformisshowninfig3.7tofig.3.10.

Fig.3.7thesinewavegenerator(

Fig.3.8thecosinewavegenerator(

Fig.3.9thesquarewave(

Fig.3.10thetrianglewave(

3.3Readthewavfileandspectrumanalysis

Fig.3.11Thetelephonedialtonesimulation

Thisfigisreadawavfileandsamplethe1to30720points.

3.4Soundcardinputandspectrumanalysis

Fig3.12thewaveformofthesoundinputfromsoundcard

Fig3.12showsthewaveforminputfromthesoundcard.Thenumberofsamplepointis20480,samplefrequency

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2