基于MATLAB的数字信号处理应用算法集(SpringerAlgorithmcollectionforDSPUsingMATLAB2007)摘要:本书是ADI官方出品的混合信号与DSP设计权威技术手册,系统讲解模数/数模转换、采样系统、数字滤波、FFT及DSP硬件实现全流程。内容涵盖ADC/DAC架构与动态性能分析、信噪比计算、采样与抗混叠滤波、Sigma-Delta转换器、FIR/IIR滤波器设计、多速率处理及自适应滤波。重点解析AD转换中的信噪比、失真与噪声优化方法,详解ADIDSP芯片架构与指令优化,配套大量工程实例与设计准则,覆盖通信、音频、传感器信号调理等应用,为混合信号系统与DSP工程开发提供完整实践指南。AlgorithmCollectionsforDigitalSignalProcessingApplicationsUsingMatlabE.S.GopiNationalInstituteofTechnology,Tiruchi,India空springerAC.I.P.CataloguerecordforthisbookisavailablefromtheLibraryofCongress.ISBN978-1-4020-6409-8(HB)ISBN978-1-4020-6410-4(e-book)PublishedbySpringer,P.O.Box17,3300AADordrecht,TheNetherlands.www.springer.comPrintedonacid-freepaperAllRightsReserved©2007SpringerNopartofthisworkmaybereproduced,storedinaretrievalsystem,ortransmittedinanyformorbyanymeans,electronic,mechanical,photocopying,microfilming,recordingorotherwise,withoutwrittenpermissionfromthePublisher,withtheexceptionofanymaterialsuppliedspecificallyforthepurposeofbeingenteredandexecutedonacomputersystem,forexclusiveusebythepurchaserofthework.ThisbookisdedicatedtomyWifeG.VijiandmySonV.G.VasigPrefaceTheAlgorithmssuchasSVD,Eigendecomposition,GaussianMixtureModel,PSO,AntColonyetc.arescatteredindifferentfields.Thereistheneedtocollectallsuchalgorithmsforquickreference.Alsothereistheneedtoviewsuchalgorithmsinapplicationpointofview.ThisBookattemptstosatisfytheaboverequirement.AlsothealgorithmsaremadeclearusingMATLABprograms.ThisbookwillbeusefulfortheBeginnersResearchscholarsandStudentswhoaredoingresearchworkonpracticalapplicationsofDigitalSignalProcessingusingMATLAB.AcknowledgmentsIamextremelyhappytoexpressmythankstotheDirectorDrM.Chidambaram,NationalInstituteofTechnologyTrichyIndiaforhissupport.IwouldalsoliketothankDrB.Venkatramani,HeadoftheElectronicsandCommunicationEngineeringDepartment,NationalInstituteofTechnologyTrichyIndiaandDrK.M.M.Prabhu,ProfessoroftheElectricalEngineeringDepartment,IndianInstituteofTechnologyMadrasIndiafortheirvaluablesuggestions.LastbutnotleastIwouldliketothankthosewhodirectlyorindirectlyinvolvedinbringingupthisbooksucessfully.SpecialthankstomyfamilymembersfatherMrE.Sankarasubbu,motherMrsE.S.Meena,SistersR.Priyaravi,M.Sathyamathi,E.S.AbinayaandBrotherE.S.Anukeerthi.ThanksE.S.GopiChapter1ARTIFICIALINTELLIGENCEAlgorithmCollections1.PARTICLESWARMALGORITHMConsiderthetwoswarmsflyinginthesky,tryingtoreachtheparticulardestination.Swarmsbasedontheirindividualexperiencechoosetheproperpathtoreachtheparticulardestination.Apartfromtheirindividualdecisions,decisionsabouttheoptimalpatharetakenbasedontheirneighbor’sdecisionandhencetheyareabletoreachtheirdestinationfaster.ThemathematicalmodelfortheabovementionedbehavioroftheswarmisbeingusedintheoptimizationtechniqueastheParticleSwarmOptimizationAlgorithm(PSO).Forexample,letusconsiderthetwovariables‘x’and‘y’asthetwoswarms.Theyareflyingintheskytoreachtheparticulardestination(i.e.)theycontinuouslychangetheirvaluestominimizethefunction(x-10)2+(y-5)2.Finalvaluefor‘x’and‘y’are10.1165and5respectivelyafter100iterations.TheFigure1-1givestheclosedlookofhowthevaluesofxandyarechangingalongwiththefunctionvaluetobeminimized.Theminimizationfunctionvaluereachedalmostzerowithin35iterations.Figure1-2showsthezoomedversiontoshowhowthepositionofxandyarevaryinguntiltheyreachthesteadystate.1.1HowaretheValuesof‘xandy’areUpdatedinEveryIteration?ThevectorrepresentationforupdatingthevaluesforxandyisgiveninFigure1-3.Letthepositionoftheswarmsbeat‘a’and‘b’respectivelyasshowninthefigure.Botharetryingtoreachtheposition‘e’.Let‘a’decidestomovetowards‘c’and‘b’decidestomovetowards‘d’.Thedistancebetweentheposition‘c’and‘e’isgreaterthanthedistancebetween‘d’and‘e’.sobasedontheneighbor’sdecisionposition‘d’istreatedasthecommonpositiondecidedbyboth‘a’and‘b’.(ie)theposition‘c’istheindividualdecisiontakenby‘a’,position‘d’istheindividualdecisiontakenby‘b’andtheposition‘d’isthecommonpositiondecidedbyboth‘a’and‘b’.1.ArtificialIntelligence‘a’basedontheaboveknowledge,finallydecidestomovetowardstheposition‘g’asthelinearcombinationof‘oa’,‘ac’and‘ad’.[As‘d’isthecommonpositiondecided].Thelinearcombinationof‘oa’andscaled‘ac’(ie)‘af’isthevector‘of’.Thevector‘of’combinedwithvector‘fg’(ie)scaledversionof‘ad’toget‘og’andhencefinalpositiondecidedby‘a’is‘g’.Similarly,‘b’decidestheposition‘h’asthefinalposition.Itisthelinearcombinationof‘ob’and‘bh’(ie)scaledversionof‘bd’.Noteas‘d’isthecommonpositiondecidedby‘a’and‘b’,thefinalpositionisdecidedbylinearcombinationsoftwovectorsalone.Thusfinallytheswarms‘a’and‘b’movestowardstheposition‘g’and‘h’respectivelyforreachingthefinaldestinationposition‘e’.Theswarm‘a’and‘b’randomlyselectscalingvalueforlinearcombination.Notethat‘oa’and‘ob’arescaledwith1(ie)actualvaluesareusedwithoutscaling.Thusthedecisionoftheswarm‘a’toreach‘e’isdecidedbyitsownintuitionalongwithitsneighbor’sintuition.Nowletusconsiderthreeswarms(A,B,C)aretryingtoreachtheparticulardestinationpoint‘D’.AdecidesA’,BdecidesB’andCdecidesC’asthenextposition.LetthedistancebetweentheB’andDislesscomparedwithA’DandC’andhence,B’istreatedastheglobaldecisionpointtoreachthedestinationfaster.ThusthefinaldecisiontakenbyAistomovetothepoint,whichisthelinearcombinationofOA,AA’andAB’.SimilarlythefinaldecisiontakenbyBistomovethepointwhichisthelinearcombinationofOB,BB’.ThefinaldecisiontakenbyCistomovethepointwhichisthelinearcombinationofOC,CC’andCB’.1.2PSOAlgorithmtoMaximizetheFunctionF(X,Y,Z)1.Initializethevaluesforinitialpositiona,b,c,d,e2.Initializethenextpositionsdecidedbytheindividualswarmsasa’,b’,c’d’ande’3.Globaldecisionregardingthenextpositioniscomputedasfollows.Computef(a’,b,c,d,e),f(a,b’,c,d,e),f(a,b,c’,d,e),f(a,b,c,d’,e)andf(a,b,c,d,e’).Findminimumamongthecomputedvalues.Iff(a’,b,c,d,e)isminimumamongall,theglobalpositiondecidedregardingthenextpositionisa’.SimilarlyIff(a,b’,c,d,e)isminimumamongall,b’isdecidedastheglobalpositionregardingthenextpositiontobeshiftedandsoon.Lettheselectedglobalpositionisrepresentedad‘global’4.Nextvalueforaiscomputedasthelinearcombinationof‘a’,(a’-a)and(global-a)(ie)•nexta=a+C1*RAND*(a’–a)+C2*RAND*(global–a)•nextb=b+C1*RAND*(b’–b)+C2*RAND*(global–b)•nextc=c+C1*RAND*(c’–c)+C2*RAND*(global–c)•nextd=d+C1*RAND*(d’–d)+C2*RAND*(global–d)•nexte=e+C1*RAND*(e’–e)+C2*RAND*(global–e)5.Changethecurrentvaluefora,b,c,dandeasnexta,nextb,nextc,nextdandnexte6.Iff(nexta,b,c,d,e)islessthanf(a’,b,c,d,e)thenupdatethevaluefora’asnexta,otherwisea’isnotchanged.Iff(a,nextb,c,d,e)islessthanf(a,b’,c,d,e)thenupdatethevalueforb’asnextb,otherwiseb’isnotchangedIff(a,b,nextc,d,e)islessthanf(a,b,c’,d,e)thenupdatethevalueforc’asnextc,otherwisec’isnotchangedIff(a,b,c,nextd,e)islessthanf(a,b,c,d’,e)thenupdatethevalueford’asnextd,otherwised’isnotchangedIff(a,b,c,d,nexte)islessthanf(a,b,c,d,e’)thenupdatethevaluefore’asnexte,otherwisee’isnotchanged7.Repeatthesteps3to6formuchiterationtoreachthefinaldecision.Thevaluesfor‘c1’,’c2’aredecidedbasedontheweightagegiventoindividualdecisionandglobaldecisionrespectively.LetΔa(t)isthechangeinthevalueforupdatingthevaluefor‘a’intthiteration,thennextaat(t+1)thiterationcanbecomputedusingthefollowingformula.Thisisconsideredasthevelocityforupdatingthepositionoftheswarmineveryiteration.nexta(t+1)=a(t)+Δa(t+1)whereΔa(t+1)=c1*rand*(a’–a)+c2*rand*(global–a)+w(t)*Δa(t)‘w(t)’istheweightattthiteration.Thevaluefor‘w’isadjustedateveryiterationasgivenbelow,where‘iter’istotalnumberofiterationused.w(t+1)=w(t)-t*w(t)/(iter).Decisiontakeninthepreviousiterationisalsousedfordecidingthenextpositiontobeshiftedbytheswarm.Butasiterationincreases,thecontributionofthepreviousdecisionisdecreasesandfinallyreacheszerointhefinaliteration.1.3M–programforPSOAlgorithmpsogv.mfunction[value]=psogv(fun,range,ITER)%psogv.m%Particleswarmalgorithmformaximizingthefunctionfunwithtwovariablesx%andy.%Syntax%[value]=psogv(fun,range,ITER)%example%fun='f1'%createthefunctionfun.m%function[res]=fun(x,y)%res=sin(x)+cos(x);%range=[-pipi;-pipi];%ITERisthetotalnumberofIterationerror=[];vel1=[];vel2=[];%Intializetheswarmpositionswarm=[];x(1)=rand*range(1,2)+range(1,1);y(1)=rand*range(2,2)+range(2,1);x(2)=rand*range(1,2)+range(1,1);y(2)=rand*range(2,2)+range(2,1);%Intializeweightw=1;c1=2;c2=2;%Initializethevelocityv1=0;%velocityforxv2=0;%velocityforyfori=1:1:ITER[p,q]=min([f1(fun,x(2),y(1))f1(fun,x(1),y(2))]);if(q==1)capture=x(2);elsecapture=y(2);endv1=w*v1+c1*rand*(x(2)-x(1))+c2*rand*(capture-x(1));v2=w*v2+c1*rand*(y(2)-y(1))+c2*rand*(capture-y(1));vel1=[vel1v1];vel2=[vel2v2];%updatingx(1)andy(1)x(1)=x(1)+v1;y(1)=y(1)+v2;%updatingx(2)andy(2)if((f1(fun,x(2),y(1)))<=(f1(fun,x(1),y(1))))x(2)=x(2);elsex(2)=x(1);end;if((f1(fun,x(1),y(2)))<=(f1(fun,x(1),y(1))))y(2)=y(2);elsey(2)=y(1);enderror=[errorf1(fun,x(2),y(2))];w=w-w*i/ITER;swarm=[swarm;x(2)y(2)];subplot(3,1,3)plot(error,'-')title('Error(vs)Iteration');subplot(3,1,1)plot(swarm(:,1),'-')title('x(vs)Iteration');subplot(3,1,2)plot(swarm(:,2),'-')title('y(vs)Iteration');pause(0.2)endvalue=[x(2);y(2)];f1.mfunction[res]=f1(fun,x,y);s=strcat(fun,'(x,y)');res=eval(s);更多内容见附件免责声明:本页面/内容部分素材来源于互联网公开信息,旨在传递更多信息,不代表本平台立场。版权归原作者或机构所有,如涉及侵权,请通过平台联系我们,我们将在核实后第一时间处理。本平台对转载内容的真实性、准确性不作任何保证,用户需自行判断并承担使用风险。