关闭

关闭

封号提示

内容

首页 DSP入门.pdf

DSP入门.pdf

DSP入门.pdf

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

简介:本文档为《DSP入门pdf》,可适用于IT/计算机领域,主题内容包含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

类似资料

编辑推荐

儿科护理查房——新生儿黄疸.ppt

春秋时期的步兵.pdf

淘股吧-职业炒手与asking_对热点的心得.docx

张贤亮小说灵与肉.doc

脂砚斋重评石头记繁体竖排打印版1--3.doc

职业精品

精彩专题

结婚彩礼真有那么重要吗?

原创于西周而后沿袭至今的彩礼,虽然被一部分家长奉为圭臬,但越来越多的年轻人对结婚必须要彩礼不以为然。彩礼引发的社会矛盾越来越受到关注,结婚是自己的事,如人饮水冷暖自知,至于要不要彩礼或者要多少彩礼,因人而异,因财力而已,不可一概而论。

用户评论

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

精选资料

热门资料排行换一换

  • 占星其实很简单2(进阶篇).pdf

  • 占星其实很简单(入门篇).pdf

  • 图解十大星体.pdf

  • 【辞典 词典集合】中国风俗大辞典…

  • 中国现代社会科学家传略 第四辑.…

  • 中国现代社会科学家传略 第三辑.…

  • 郑贵友语法讲义.doc

  • 【辞典 词典集合】中共党史人物别…

  • 中国针灸独穴疗法(陈德成).pdf

  • 资料评价:

    / 16
    所需积分:1 立即下载

    意见
    反馈

    返回
    顶部