首页 > > > DSP入门.pdf

DSP入门.pdf

DSP入门.pdf

上传者: 寻觅虚无 2013-12-13 评分1 评论0 下载0 收藏10 阅读量221 暂无简介 简介 举报

简介:本文档为《DSP入门pdf》,可适用于硬件技术领域,主题内容包含CHAPTERSHARC,EZKIT,EZLAB,VisualDSP,EZICE,theSHARClogo,theAnalogDeviceslogo符等。

CHAPTERSHARC,EZKIT,EZLAB,VisualDSP,EZICE,theSHARClogo,theAnalogDeviceslogo,andtheVisualDSPlogoareregisteredtrademarksofAnalogDevices,IncGettingStartedwithDSPsOnceyoudecidethataDigitalSignalProcessorisrightforyourapplication,youneedawaytogetstartedManymanufacturerswillsellyoualowcostevaluationkit,allowingyoutoexperiencetheirproductsfirsthandTheseareagreateducationaltoolitdoesn'tmatterifyouareanoviceorapro,theyarethebestwaytobecomefamiliarwithaparticularDSPForinstance,AnalogDevicesprovidestheEZKITLitetoteachpotentialcustomersaboutitsSHARCfamilyofDigitalSignalProcessorsForonly$,youreceiveallthehardwareandsoftwareyouneedtoseetheDSPinactionThisincludes"canned"programsprovidedwiththekit,aswellasapplicationsyoucanwriteyourselfinassemblyorCSupposeyoubuyoneofthesekitsfromAnalogDevicesandplaywithitforafewdaysThischapterisanoverviewofwhatyoucanexpecttofindandlearnTheADSPxfamilyInthelastchapterwelookedatthegeneraloperationoftheADSPx"SHARC"familyofDigitalSignalProcessorsTableshowsthevariousmembersofthisfamilyAllthesedevicesusethesamearchitecture,buthavedifferentamountsofonchipmemory,akeyfactorindecidingwhichonetouseMemoryaccessisacommonbottleneckinDSPsystemsTheSHARCDSPsaddressthisbyprovidinganamplesupplyofonchipdualportedSRAMHowever,thelastthingyouwanttodoispayformorememorythanyouneedDSPsoftengointocostsensitiveproducts,suchascellulartelephonesandCDplayersInotherwords,theorganizationofthisfamilyisdeterminedbymarketingaswellastechnologyTheoldestmemberofthisfamilyistheADSPThischipcontainsthecorearchitecture,butdoesnotincludeonchipmemoryorIOhandlingThismeansitcannotfunctionasastandalonecomputeritrequiresexternalcomponentstobeafunctionalsystemTheotherdevicesarecompleteTheScientistandEngineer'sGuidetoDigitalSignalProcessingPRODUCTMemoryNotesADMbitQuadSHARC,FourADSP'sinthesamemoduleprovidesanincredibleMFLOPSinonly"""ADSPMMbitNew!FeaturesSingleInstructionMultipleData(SIMD)corearchitectureoptimizedformultiprocessingwithlinkports,bitexternalbus,andchannelsofDMAADSPMbitPowerhouseofthefamilymostmemorylinkportsforhighspeeddatatransferandmultiprocessingADSPMbitSamefeaturesastheADSP,butwithlessinternalmemory(SRAM),forlowercostADSPMbitLowcostversionusedintheEZKITLitelessmemorynolinkportsadditionalfeaturesinDMAfortheserialportADSPLkbitArecentadditiontothefamilyfastandverylowcost($)WillattractmanyfixedpointapplicationstotheSHARCfamilyADSPOldestmemberofthefamilyContainsthecoreprocessor,butnoonchipmemoryorIOinterfaceNotquiteaSHARCDSPTABLEMembersoftheSHARCfamilycomputerswithinasinglechipAlltheyrequiretooperateisasourceofpower,andsomewaytoloadaprogramintomemory,suchasanexternalPROMordatalinkNoticeinTablethateventhelowendproductshaveaverysignificantamountofmemoryForinstance,theADSPLhaskbitsofinternalSRAMThisisenoughtoholdsecondsofdigitizedspeech(ksamplespersecond,bitspersample)Onthehighendofthefamily,theADSPhasaMbitmemoryThisismorethanenoughtostoreanentiredigitizedimage(pixels,bitsperpixel)Ifyourequireevenmorememory,youeasilyaddexternalSRAM(orslowermemory)toanyofthesedevicesInadditiontomemory,therearealsodifferencesbetweenthesefamilymembersintheirIOsectionsTheADSPandADSP(thehighend)eachhavesixlinkportsThesearebitwideparallelconnectionsforcombiningDSPsinmultiprocessingsystems,andotherapplicationsthatrequireflexiblehighspeedIOTheADSPandADSPL(thelowend)donothavelinkports,butfeaturemoreDMAchannelstoassistintheirserialportoperationYouwillalsoseethesepartnumberswithan"L"or"M"afterthem,suchas"ADSPL"ThisindicatesthatthedeviceoperatesfromavoltagelowerthanthetraditionalvoltsForChapterGettingStartedwithDSPsSHARCUARTRSDriverPROMCODECemulatorconnectorprocessorbusserialportportslinkADSPflagLEDsflagIRQresetPOWERvdc,ampaudioinaudioout(toPC)ExpansionserialcableserialJTAGportFIGUREBlockdiagramoftheEZKITLiteboardOnlyfourexternalconnectionsareneeded:audioin,audioout,aserial(RS)cabletoyourpersonalcomputer,andpowerTheserialcableandpowersupplyareprovidedwiththeEZKITLiteinstance,theADSPLoperatesfromvolts,whiletheADSPMusesonlyvoltsInJune,AnalogDevicesunveiledthesecondgenerationofitsSHARCarchitecture,withtheannouncementoftheADSPThisfeaturesaSingleInstructionMultipleData(SIMD,or"simdee")corearchitectureoperatingatMHz,anacceleratedmemorybusbandwidthofmegabytespersecond,twobitdatabusses,andfourbitaccumulatorsforfixedpointcalculationsAlltotaled,thenewADSPMexecutesapointFFTinonlymicrosecondsTheSIMDDSPcontainsasecondsetofcomputationalunits(arithmeticandlogicunit,barrelshifter,dataregisterfile,andmultiplier),allowingADItomaintainbackwardcodecompatibilitywiththeADSPxfamily,whileprovidingaroadmaptouptotentimeshigherperformanceTheSHARCEZKITLiteTheEZkitLitegivesyoueverythingyouneedtolearnabouttheSHARCDSP,including:hardware,software,andreferencemanualsFigureshowsablockdiagramofthehardwareprovidedintheEZKITLite,basedaroundtheADSPDigitalSignalProcessorThiscomesasainchprintedcircuitboard,mountedonplasticstandoffstoallowittositonTheScientistandEngineer'sGuidetoDigitalSignalProcessingyourdesk(ThereisalsoaversioncalledtheEZLAB,usingtheADSP,thatplugsintoaslotinyourcomputer)Thereareonlyfourconnectionsyouneedtoworryabout:DCpower,aserialconnectiontoyourpersonalcomputer,andtheinputandoutputsignalsADCpowersupplyandserialcableareevenprovidedinthekitTheinputandoutputsignalsareataudiolevel,aboutvoltamplitudeAlternatively,ajumperontheboardallowsamicrophonetobedirectlyattachedintotheinputTheideaistoplugamicrophoneintotheinput,andattachasetofamplifiedspeakers(suchasusedwithpersonalcomputers)totheoutputThisallowsyoutoheartheeffectofvariousDSPalgorithmsAnalogtodigitalanddigitaltoanalogconversionisaccomplishedwithanAnalogDevicesADcodec(coderdecoder)Thisisabitsigmadeltaconverter,capableofdigitizingtwochannels(stereo)atarateofuptoksamplessecond,andsimultaneouslyoutputingtwochannelsatthesamerateSincetheprimaryuseofthisboardistoprocessaudiosignals,theinputsandoutputsareACcoupledwithacutoffofaboutHzThreepushbuttonsontheboardallowtheusertogenerateaninterrupt,resettheprocessor,andtoggleaflagbitthatcanbereadbythesystemFourLEDsmountedontheboardcanbeturnedonandoffbytogglingbitsIfyouareambitious,therearesectionsoftheboardthatallowyoutoaccesstheserialport,linkports(onlyontheEZLABwithitsADSP),andprocessorbusHowever,theseareunpopulated,andyouwillneedtoattachtheconnectorsandothercomponentsyourselfHere'showitworksWhenthepowerisapplied,theprocessorbootsfromanonboardEPROM(kbytes),loadingaprogramthatestablishesserialcommunicationwithyourpersonalcomputerNext,youlaunchtheEZLiteHostprogramonyouPC,allowingyoutodownloadprogramsanduploaddatafromtheDSPSeveralprewrittenprogramscomewiththeEZKITLitethesecanberunbysimplyclickingoniconsForinstance,abandpassprogramallowsyoutospeakintothemicrophone,andheartheresultafterpassingthroughabandpassfilterTheseprogramsareusefulfortworeasons:()theyallowyoutoquicklygetthesystemdoingsomethinginteresting,givingyouconfidencethatitdoeswork,and()theyprovideatemplateforcreatingprogramsofyourownWhichbringsustoournexttopic,adesignexampleusingtheEZKITLiteDesignExample:AnFIRAudioFilterAfteryouexperimentwiththeprewrittenprogramsforawhile,youwillwanttomodifythemtogainexperiencewiththeprogrammingProgramscanbewrittenineitherassemblyorCtheEZKITLiteprovidessoftwaretoolstosupportbothlanguagesLaterinthischapterwewilllookatadvancedmethodsofprogramming,suchassimulation,debugging,andworkinginanintegrateddevelopmentenvironmentFornow,wewillfocusontheeasiestwaytogetaprogramtorunLittlestepsforlittlefeetChapterGettingStartedwithDSPsFrequencyaFrequencyresponseSamplenumberbImpulseresponse(filterkernel)FIGUREExampleFIRfilterIn(a)thefrequencyresponseofahighlycustomfilterisshownThecorrespondingimpulseresponse(filterkernel)isshownin(b)ThisfilterwasdesignedinChaptertoshowthatvirtuallyanyfrequencyresponsecanbeachievedwithFIRdigitalfiltersAmplitudeAmplitudeSincethesourcecodeisinASCII,astandardtexteditorisallthatisneededtomakechangestoexistingfiles,orcreateentirelynewprogramsTableshowsanexampleofanFIRfilterprogramwritteninassemblyWhilethisistheonlycodeyouneedtoworryaboutfornow,keepinmindthatthereareotherfilesneededtomakethisacompleteprogramThisincludesan"architecturedescriptionfile"(whichdefinesthehardwareconfigurationandmemoryallocation),setupoftheinterruptvectortable,andacodecinitializationroutineEventuallyyouwillneedtounderstandwhatgoesoninthesesections,butfornowyousimplycopythemfromtheprewrittenprogramsAsshownatthetopofTable,therearethreevariablesthatneedtobedefinedbeforejumpingintothemainsectionofcodeThesearethenumberofpointsinthefilterkernel,NRCOEFacircularbufferthatholdsthepastsamplesfromtheinputsignal,dlineandacircularbufferthatholdsthefilterkernel,coefWealsoneedtogivetheprogramtwootherpiecesofinformation:thesamplingrateofthecodec,andthenameofthefilecontainingthefilterkernel,sothatitcanbereadintocoefAllthesestepsareeasynothingmorethanasinglelineofcodeeachWedon'tshowtheminthisexamplebecausetheyarecontainedinthesectionsofcodethatweareignoringforsimplicityFigureshowsthefilterkernelwewilltesttheprogramwith,thesamecustomfilterwedesignedinChapterAsyourecall,thisfilterwaschosentohaveaveryirregularfrequencyresponse,reinforcingthenotionthatFIRdigitalfilterscanprovidevirtuallyanyfrequencyresponseyoudesireFigure(a)showsthefrequencyresponseofourtestfilter,while(b)showsthecorrespondingimpulseresponse(ie,thefilterkernel)ThispointfilterkernelisstoredinanASCIIfile,andiscombinedwiththeothersectionsofcodeduringlinkingtoformasingleexecutableprogramTheScientistandEngineer'sGuidetoDigitalSignalProcessingThemainsectionoftheprogramperformstwofunctionsInlinesto,thedataaddressgenerators(DAGs)areconfiguredtomanagethecircularbuffers:dline,andcoefAsdescribedinthelastchapter,threeparametersareneededforeachbuffer:thestartinglocationofthebufferinmemory(bandb),thelengthofthebuffer(landl),andthestepsizeofthedatabeingstoredinthebuffer(mandm)TheseparametersthatcontrolthecircularbuffersarestoredinhardwareregistersintheDAGs,allowingthemtoaccessandmanagethedataveryefficientlyThesecondactionofthemainprogramisa"thumbtwiddling"loop,implementedinlinestoThisdoesnothingbutwaitforaninterruptindicatingthataninputsamplehasbeenacquiredAlloftheprocessinginthisprogramoccursonasamplebysamplebasisEachtimeasampleisreadfromtheinput,asampleintheoutputsignaliscalculatedandroutedtothecodecMosttimedomainalgorithms,suchasFIRandIIRfilters,fallintothiscategoryThealternativeisframebyframeprocessing,whichisrequiredforfrequencydomaintechniquesIntheframebyframemethod,agroupofsamplesisreadfromtheinput,calculationsareconducted,andagroupofsamplesiswrittentotheoutputThesubroutinethatservicesthesamplereadyinterruptisbrokenintothreesectionsThefirstsection(linesto)fetchesthesamplefromthecodecasafixedpointnumber,andconvertsittofloatingpointInSHARCassemblylanguage,adataregisterholdingafixedpointnumberisreferredtoby"r"(suchasr,r,r,etc),andby"f"ifitisholdingafloatingpointnumber(ie,f,f,orf)Forinstance,inline,thefixedpointnumberindataregister(ie,r)isconvertedintoafloatingpointnumberandoverwritesdataregister(ie,f)Thisconversionisdoneaccordingtoascalingspecifiedbythefixedpointnumberindataregister(ier)Inthethirdsection(linesto),theoppositestepstakeplacethefloatingpointnumberfortheoutputsampleisconvertedtofixedpointandsenttothecodecTheFIRfilterthatconvertstheinputsamplesintotheoutputsamplesiscontainedinlinestoAllthecalculationsarecarriedoutinfloatingpoint,avoidingtheneedtoworryaboutscalingandoverflowAsdescribedinthelastchapter,thissectionofcodeisoptimizedtotakeadvantageoftheSHARCDSP'sabilitytoexecutemultipleinstructionseachclockcycleAfterwehavetheassemblyprogramwrittenandthefilterkerneldesigned,wearereadytocreateaprogramthatcanbeexecutedontheSHARCDSPThisisdonebyrunningthecompiler,theassembler,andthenthelinkerthreeprogramsprovidedwiththeEZKITLiteThecompilerconvertsaCprogramintotheSHARC'sassemblylanguageIfyoudirectlywritetheprograminassembly,suchasinthisexample,youbypassthisstepTheassemblerandlinkerconverttheprogramandexternalfiles(suchasthearchitecturefile,codecinitializationroutines,filterkernel,etc)intothefinalexecutablefileAllthistakesaboutseconds,withthefinalresultbeingaSHARCprogramresidingontheharddiskofyourPCTheEZKITLitehostisthenusedtoruntheprogramontheEZKITLiteSimplyclickChapterGettingStartedwithDSPsTABLEFIRfilterprograminassemblyBeforeenteringthemainprogram,thefollowingconstantandvariablesmustbedefined:NRCOEFThenumberofcoefficientsinthefilterkernel(inthisexample)dlineNRCOEFAcircularbufferholdingthepastinputsamples,indatamemorycoefNRCOEFAcircularbufferholdingthefiltercoefficients,inprogrammemory******************************************************************************************MAINPROGRAM**********************************************************************************************main:*INITIALIZETHEDAGSTOCONTROLTHECIRCULARBUFFERS*b=dline*setupdline,thebufferholdingthepastinputsamples*l=dlinem=b=coef*setupcoef,thebufferholdingthefiltercoefficients*l=coefm=*ENTERALOOP,WAITINGFORTHESAMPLEREADYINTERRUPT*wait:idlejumpwait********************************************************************************SUBROUTINETOPROCESSONESAMPLE**********************************************************************************sampleready:*ACQUIRETHEINPUTSAMPLE,CONVERTTOFLOATINGPOINT*r=dm(rxbuf)*movetheinputsampleintor*r=lshiftrby*shifttothehighestbitstopreservethesign*r=*setthescalingfortheconversion*f=floatrbyr*convertfromfixedtofloatingpoint*dm(i,m)=f*storethenewsampleindline,andzerof**CALCULATETHEOUTPUTSAMPLEFROMTHEFIRFILTER*f=*primetheregisters*f=dm(i,m),f=pm(i,m)f=f*f,f=dm(i,m),f=pm(i,m)*efficientmainloop*lcntr=NRCOEF,do(pc,)untillcef=f*f,f=ff,f=dm(i,m),f=pm(i,m)f=f*f,f=ff*completethelastloop*f=ff*CONVERTTHEOUTPUTSAMPLETOFIXEDPOINTOUTPUT*r=*setthescalingfortheconversion*r=fixfbyr*convertfromfloatingtofixedpoint*rti(db)*returnfrominterrupt,butexecutenextlines*r=lshiftrby*shifttothelowestbits*dm(txbuf)=r*movethesampletotheoutput*TheScientistandEngineer'sGuidetoDigitalSignalProcessingEZKITSignalGeneratorOscilloscopeinputoutputFIGURETestingtheEZKITLiteAnalogengineerstesttheperformanceofasystembyconnectingasignalgeneratortoitsinput,andanoscilloscopetoitsoutputWhenaDSPsystem(suchastheEZKITLite)istestedinthisway,itappearstobeavirtuallyperfectanalogsystemonthefileyouwanttheDSPtorun,andtheEZKITLitehosttakescareoftherest,downloadingtheprogramandstartingitrunningThisbringsustotwoquestionsFirst,howdowetestouraudiofiltertomakesureitisoperatingaswedesigneditandsecond,whatintheworldisacompanycalledAnalogDevicesdoingmakingDigitalSignalProcessorsAnalogmeasurementsonaDSPsystemForjustafewmoments,forgetthatyouarestudyingdigitaltechniquesLet'stakealookatthisfromthestandpointofanengineerthatspecializesinanalogelectronicsHedoesn'tcarewhatisinsideoftheEZKITLite,onlythatithasananaloginputandananalogoutputAsshowninFig,hewouldinvokethetraditionalanalogmethodofanalyzinga"blackbox,"attachasignalgeneratortotheinput,andlookattheoutputonanoscilloscopeWhatdoesouranaloggurufindFirst,thesystemislinear(asleastasfarasthissimpletestcantell)Ifasinewaveisplacedintotheinput,asinewaveisobservedontheoutputIftheamplitudeorfrequencyoftheinputischanged,acorrespondingchangeisseenintheoutputWhentheinputfrequencyisslowlyincreased,therecomesapointwheretheamplitudeoftheoutputsinewavedecreasesrapidlytozeroThatoccurs

精彩专题

热门资料

修改电脑右下角时间样式的方法.doc

手机内存卡制作u盘启动盘的方法.doc

SPI模式下SD卡驱动的设计与实现.pdf

SD卡I_O接口设计.pdf

该用户的其他资料

  • 名称/格式
  • 评分
  • 下载次数
  • 资料大小
  • 上传时间

用户评论

0/200
    暂无评论
上传我的资料

相关资料换一换

资料评价:

/ 16
所需积分:1 立即下载
返回
顶部
举报
资料
关闭

温馨提示

感谢您对爱问共享资料的支持,精彩活动将尽快为您呈现,敬请期待!