/
Application Report SNAAA April  Revised May  AN LM Automatic Gain Control AGC Guide Application Report SNAAA April  Revised May  AN LM Automatic Gain Control AGC Guide

Application Report SNAAA April Revised May AN LM Automatic Gain Control AGC Guide - PDF document

liane-varnes
liane-varnes . @liane-varnes
Follow
570 views
Uploaded On 2014-12-12

Application Report SNAAA April Revised May AN LM Automatic Gain Control AGC Guide - PPT Presentation

ABSTRACT This report provides information on the operation and settings of the automatic gain control circuit Contents Automatic Gain Control AGC Overview ID: 22343

ABSTRACT This report provides

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Application Report SNAAA April Revised ..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

ApplicationReport SNAA028A–April2006–RevisedMay2013 AN-1451LM4935AutomaticGainControl(AGC)Guide ..................................................................................................................................................... ABSTRACT Thisreportprovidesinformationontheoperationandsettingsoftheautomaticgaincontrolcircuit. Contents 1AutomaticGainControl(AGC)Overview................................................................................2 2AGCOperation..............................................................................................................2 3AGCSettingsExplained...................................................................................................3 3.1AGC_TARGET(bits3:1(0x08h)).................................................................................3 3.2AGC_FRAME_TIME(bits5:3(0x07h))..........................................................................4 3.3AGC_HOLDTIME(bits4:0(0x0Ah)).............................................................................4 3.4AGC_ATTACK(bits7:5(0x0Ah)).................................................................................4 3.5AGC_DECAY(bits6:4(0x09h))..................................................................................4 3.6AGC_MAX_GAIN(bits3:0(0x09h))..............................................................................4 3.7AGC_TIGHT(bit7(0x09h)).......................................................................................4 3.8ADC_SAMPLERATE(bits5:4(0x06h))..........................................................................4 3.9NOISE_GATE_THRES(bits7:5(0x08h)).......................................................................5 3.10NOISE_GATE_ON(bit4(0x08h))................................................................................5 4RecommendedAGCSettings.............................................................................................5 5RevisionHistory.............................................................................................................6 ListofFigures 1AGCLoop....................................................................................................................2 2AGCOperationExample...................................................................................................3 3ANoisyAudioSignalwithNOISE_GATE_ONDisabled...............................................................5 4TheSameAudioSignal(Figure3)withNOISE_GATE_ONEnabled...............................................5 Alltrademarksarethepropertyoftheirrespectiveowners. 1 SNAA028A–April2006–RevisedMay2013 AN-1451LM4935AutomaticGainControl(AGC)Guide SubmitDocumentationFeedback Copyright©2006–2013,TexasInstrumentsIncorporated AutomaticGainControl(AGC)Overviewwww.ti.com 1AutomaticGainControl(AGC)Overview Amicrophoneistypicallyusedinanenvironmentwheretheleveloftheaudiosourceisunknown.The LM4935featuresanAutomaticGainControl(AGC)circuitthataddressesthissituationbycompensation forsignificantvariationsinlevelfromamicrophone’sinput.Itmaintainsafixedlevelduringrecordingor playback.ThefollowingscenariosshowcasetherealworldbenefitsoftheAGCcircuit: Scenario1: Ausertalkstooloudlyortooclosetothemicrophone.Thiscausesaclippedvoicesignalattheoutputof themicrophonepreamplifier. WithoutAGC Theuseratthereceivingendhearsaclippedsignal.Thisclippedsignalsoundsdistorted.Further,itmay damagethereceiving-endtransducerormaycausehearingloss. WithAGC TheAGCautomaticallylowersthemicrophonepreamplifiergain.Thispreventsvoicesignalclipping.The resultingundistorted,unclippedvoicesignalisthenpresentedtotheuseronthereceivingend. Scenario2: Ausertalkstoosoftlyortoofarawayfromthemicrophone. WithoutAGC Theresultantlow-levelvoicesignalmaynotbeheardclearlyoratallbytheuseratthereceivingend. WithAGC TheAGCwillautomaticallyincreasethegainofthemicrophonepreamplifiertoalevelthatisheardclearly bytheuseratthereceivingend. Asshowninthescenariosabove,theAGCoperatesbyautomaticallyadjustingthegainofthemicrophone preamplifiertomaintainapre-definedtargetlevelattheamplifier'soutput.TheAGCloopisshownin Figure1. Figure1.AGCLoop 2AGCOperation TheAGCcircuitadjuststheleveloftheinputappliedtotheADC.Thisoptimizesthedynamicrangeofthe voicedatawhenthelevelofthesourceisunknown.Atargetlevelfortheoutputissetsothatany transientsonthemicrophoneinputwillnotclipduringnormaloperation.TheAGCcircuitcomparesthe outputoftheADCtothistargetlevelandincreasesordecreasesthegainofthemicrophonepreamplifier tocompensate.TheADC'sfulldynamicrangeisrealizedwhentheAGCoptimizesmicrophone preamplifieroutputsignalmagnitude. 2 AN-1451LM4935AutomaticGainControl(AGC)Guide SNAA028A–April2006–RevisedMay2013 SubmitDocumentationFeedback Copyright©2006–2013,TexasInstrumentsIncorporated www.ti.comAGCSettingsExplained ToensurethattheAGCcircuitdoesnotreducethequalityofthespeechbyconstantlymodulatingthe microphonepreamplifiergain,theADCoutputispassedthroughanenvelopedetector.Theenvelope detectorframestheoutputoftheADCintotimesegmentsroughlyequaltothephonemesfoundinspeech (AGC_FRAMETIME).Tocalculatethis,theAGCcircuitmustalsoknowtheADC'ssamplerate (ADC_SAMPLERATE).If,afteraprogrammablenumberofthesesegments(AGC_HOLDTIME),thelevel isconsistentlybelowtarget,themicrophoneamplifier'sgainisincreasedataprogrammablerate (AGC_DECAY).Ifthesignaleverexceedsthetargetlevel(AGC_TARGET),thegainofthemicrophoneis reducedimmediatelyataprogrammablerate(AGC_ATTACK).TheAGC'soperationisdemonstratedin Figure2. Figure2.AGCOperationExample TheADCinputsignalshowninFigure2isinitiallyatalowlevel.Aftertheholdtimehasfinished,thegain rises((1):(2)).Later,themicrophoneoutputsignal'samplitudeincreasesandreachesthethresholdfora gainreduction.Thisreductionisprogrammedtodecreasethegainatafasterrate((2):(3)),toallowthe eliminationoftypicalpoppingnoises. OnlyADCoutputsthatareconsideredsignal(ratherthannoise)areusedtoadjustthemicrophone preamplifiergain.Thesignal-to-noiseratio(SNR)oftheexpectedinputsignalissetby NOISE_GATE_THRESHOLD.Insomesituations,itispreferabletoremoveaudioconsideredtobesolely backgroundnoisefromtheaudiooutput;forexamplethebackgroundnoiseduringaconferencecalls. ThiscanbedonebysettingNOISE_GATE_ON.ThisdoesnotaffecttheperformanceoftheAGC algorithm. TheAGCalgorithmshouldnotbeusedwherehighamplitudebackgroundnoiseispresent.Ifthetypeof inputdata,application,andmicrophoneisknown,theAGCwilltypicallynotberequiredforgood performance.TheAGCisintendedforusewithinputswithalargedynamicrangeorunknownnominal level.WhensettingNOISE_GATE_THRESHOLD,beawarethatinsomemobilephonescenariosthe ADCSNRwillbedictatedbythemicrophoneperformanceratherthantheADCorthesignal.Microphone preamplifiergainchangesareperformedonzerocrossingsensuringnozippernoise.EnabletheADC's highpassfiltertoeliminateDCoffsets,windnoise,andpopsoundsfromtheoutputoftheADC. 3AGCSettingsExplained 3.1AGC_TARGET(bits3:1(0x08h)) ThisisthepredefinedaudiosignalmagnitudetargetlevelattheinputoftheADCthatismaintainedbythe AGCalgorithm.Thistargetlevelcanbeprogrammedfrom–6dBFSto–20dBFSin2dBFSsteps.Thereis adelaybetweenwhentheAGCattenuatestheADCinputandwhenitreadstheADCoutput.Duringthis delay,theADCinputsignalmayclipifthereisnotenoughheadroomavailable.Theheadroomshouldbe approximatelythedifferencebetweentheaveragesignallevelandtheleveloftheexpectedtransients.In ordertomaximizethedynamicrangeoftheADC,thereferenceleveloftheexpectedtransientsshouldbe setatthemaximuminputleveloftheADC(Fullscale=1Vrms).Therefore,itisrecommendedtoset AGC_TARGETatthedifferencebetweentheaveragesignalleveland0dBFS.Fortypicalspeech patterns,anAGC_TARGETsettingof-12dBFSor-14dBFSisagoodstartingpoint. 3 SNAA028A–April2006–RevisedMay2013 AN-1451LM4935AutomaticGainControl(AGC)Guide SubmitDocumentationFeedback Copyright©2006–2013,TexasInstrumentsIncorporated AGCSettingsExplainedwww.ti.com 3.2AGC_FRAME_TIME(bits5:3(0x07h)) ThissetstheframetimetobeusedbytheAGCalgorithm.Inagivenframe,theAGC’speakdetector determinesthepeakvalueoftheincomingmicrophoneaudiosignallevelandcomparesthisvaluetothe targetvalueoftheAGC(AGC_TARGET)inordertoadjustthemicrophonepreamplifier’sgain.Thelength ofaframedeterminesthesamplerateoftheAGC.Theframetimecanbesetfrom96msto1000ms,an adjustmentrangeforawidevarietyofspeechpatterns. 3.3AGC_HOLDTIME(bits4:0(0x0Ah)) Thisbitsetstheamountofdelay(bycontrollingthenumberofframespassedtotheADC)beforetheAGC algorithmbeginstoadjustthegainofthemicrophonepreamplifier.Theholdtimecanbesetfrom0to31 frames.ThelengthofeachframeissetbyAGC_FRAME_TIME.Forexample,anAGC_HOLDTIMEset for2framesandanAGC_FRAMETIMEsetfor96msgivesatotaldelaytimeof192ms. DelayTime=(AGC_HOLDTIME)x(AGC_FRAME_TIME) DelayTime=(2)x(96ms)=192ms Forthisparticularexample,theAGCalgorithmwillnotadjustthemicrophonepreamplifiergainuntila delayof192msafterasignalispresentontheADC. 3.4AGC_ATTACK(bits7:5(0x0Ah)) SettingthisbitsetstherateatwhichtheAGCwillreducethemicrophonepreamplifier’sgainwhenthe inputsignallevelislargerthanthetargetlevelsetbyAGC_TARGET.Whenevertheinputlevelisgreater thanthetargetlevel,theAGCimmediatelydecreasesthemicrophonepreamplifiergainonthenextzero crossing.Theattacktimeistheamountoftimebetweeneachsteptodecreasethegain.Ithasarange from32msto4096ms. 3.5AGC_DECAY(bits6:4(0x09h)) ThisbitsetstherateatwhichtheAGCwillincreasethemicrophonepreamplifiergainwhentheinput signallevelissmallerthanthetargetlevelsetbyAGC_TARGET.Whenevertheinputsignallevelislesser thanthetargetlevel,theAGCwaitsfortheholdtimeandthenincreasesthemicrophonepreamplifiergain onthenextzerocrossing.ToensuremaximumSNR,theAGCdoesnotincreasethemicrophone preamplifiergainwhentheinputsignallevelisbelowthenoisefloorassetbytheNOISE_GATE_THRES. Thedecaytimeistheamountoftimebetweeneachsteptoincreasethegain.Ithasarangefrom32msto 4096ms. 3.6AGC_MAX_GAIN(bits3:0(0x09h)) ThisbitsetsthemaximumgainthattheAGCcanapplytothemicrophonepreamplifier.Themaximum gaincanbesetfrom6dBto36dBin2dBsteps. 3.7AGC_TIGHT(bit7(0x09h)) SettingthisbitallowstheAGCgainalgorithmtocontrolthemicrophonepreamplifiergainsothatthe outputsignallevelcloselymatchestheAGCtargetlevel. TheAGCisusedtooptimizethemicrophonepreamplifieroutputsignallevel,whetherintendedforthe LM4935'sanalogoutputstagesorasaninputsignalfortheADC.Whentheanalogpathisused,thisbit shouldbecleared.Thisallowsgreaterdynamicrangefortheaudiosignalattheoutputstages.Whenthe microphoneinputisroutedtotheADCforrecordingorplayback,theAGC_TIGHTbitshouldbesetto ensurethattheaudiosignaltightlyadherestothetargetlevel. 3.8ADC_SAMPLERATE(bits5:4(0x06h)) ThisvariableisusedbytheAGCalgorithm.ItinformstheAGCcircuitabouttheclosestexpectedADC samplerate.ThisbitdoesnotsettheactualADCsamplerate.ADC_SAMPLERATEcanbesetto8kHz, 12kHz,16kHz,or24kHz.ItisrecommendedthattheselectedADC_SAMPLERATEsettingclosely matchestheactualADCsampleratesothattheAGCworksproperly. 4 AN-1451LM4935AutomaticGainControl(AGC)Guide SNAA028A–April2006–RevisedMay2013 SubmitDocumentationFeedback Copyright©2006–2013,TexasInstrumentsIncorporated www.ti.comRecommendedAGCSettings 3.9NOISE_GATE_THRES(bits7:5(0x08h)) ThissettingtellstheAGCmagnitudeoftheexpectedbackgroundnoiselevelrelativetothepeaksignal level.ThepresenceofsignalsbelowthislevelwillberemovedfromtheADCoutputandwillnotproduce anAGCgainchange.Thispreventsbackgroundnoisefrombeingunnecessarilyamplifiedduringperiods ofsilenceinaconversation.Thenoisegatethresholdlevelcanbesetfrom–72dBto–30dB.Thislevel mustbedefinedevenifthenoisegateisnotinuse,becausethislevelisrequiredbytheAGCalgorithm. 3.10NOISE_GATE_ON(bit4(0x08h)) Settingthisbitwillmutecausetheamplifiertomutesignalsthatarebelowthenoisegatethresholdlevel definedbyNOISE_GATE_THRES.Whenthenoisegateisenabledandnosignalisdetected,thenoise gatewaitsforadelaytimeequalto(AGC_FRAMETIME)x(AGC_HOLDTIME)topassandthenmutes anysignalbelowthenoisegatethresholdlevel.Whenasignallargerthanthenoisegatethresholdlevelis detected,thenoisegateunmutesthesignalonthenextzerocrossing.Figure3andFigure4showthe effectofthenoisegateonthesameaudiosignal. Figure3.ANoisyAudioSignalwithNOISE_GATE_ONDisabled Figure4.TheSameAudioSignal(Figure3)withNOISE_GATE_ONEnabled Whenusingthenoisegate,thereisatradeoffbetweeneliminatingbackgroundnoiseduringmomentsof silenceandmaintainingtheoriginalrelevantaudioinformation.Figure4showstheeliminationof backgroundnoisefoundfromthenoisywaveformshowninFigure3.However,someoftheaudio transientswerealsoreduced.Thisisaresultofthenoisegate'saction:onceitdetectsasignallargerthan thenoisegatethreshold,thegateunmutesthesignalonthenextzerocrossing.Setting NOISE_GATE_THREStoitsminimumof–72dBreducesthepossibilityofrelevantaudioinformationbeing muted,butmayincreasethechanceofunwantedbackgroundnoiseleakingthrough. 4RecommendedAGCSettings HerearetherecommendedstartingpointsfortuningtheAGCforvoiceconversations. AGC_TARGET=-12dB AGC_FRAMETIME=96ms AGC_HOLDTIME=1frame AGC_ATTACK=64ms AGC_DECAY=64ms AGC_MAX_GAIN=36dB 5 SNAA028A–April2006–RevisedMay2013 AN-1451LM4935AutomaticGainControl(AGC)Guide SubmitDocumentationFeedback Copyright©2006–2013,TexasInstrumentsIncorporated RevisionHistorywww.ti.com AGC_TIGHT=Enabled ADC_SAMPLERATE=closestsampleratetotheactualsamplerateoftheADC NOISE_GATE_THRES=-72dBFS NOISE_GATE_ON=Enabled TheeffectoftheAGCishighlysubjectiveandsystemdependent,thereforefurthertuningmaybe required. 5RevisionHistory Rev Date Description 0.1 04/24/06 Initialrelease. 6 AN-1451LM4935AutomaticGainControl(AGC)Guide SNAA028A–April2006–RevisedMay2013 SubmitDocumentationFeedback Copyright©2006–2013,TexasInstrumentsIncorporated IMPORTANTNOTICE TexasInstrumentsIncorporatedanditssubsidiaries(TI)reservetherighttomakecorrections,enhancements,improvementsandother changestoitssemiconductorproductsandservicesperJESD46,latestissue,andtodiscontinueanyproductorserviceperJESD48,latest issue.Buyersshouldobtainthelatestrelevantinformationbeforeplacingordersandshouldverifythatsuchinformationiscurrentand complete.Allsemiconductorproducts(alsoreferredtohereinas“components”)aresoldsubjecttoTI’stermsandconditionsofsale suppliedatthetimeoforderacknowledgment. TIwarrantsperformanceofitscomponentstothespecificationsapplicableatthetimeofsale,inaccordancewiththewarrantyinTI’sterms andconditionsofsaleofsemiconductorproducts.TestingandotherqualitycontroltechniquesareusedtotheextentTIdeemsnecessary tosupportthiswarranty.Exceptwheremandatedbyapplicablelaw,testingofallparametersofeachcomponentisnotnecessarily performed. TIassumesnoliabilityforapplicationsassistanceorthedesignofBuyers’products.Buyersareresponsiblefortheirproductsand applicationsusingTIcomponents.TominimizetherisksassociatedwithBuyers’productsandapplications,Buyersshouldprovide adequatedesignandoperatingsafeguards. TIdoesnotwarrantorrepresentthatanylicense,eitherexpressorimplied,isgrantedunderanypatentright,copyright,maskworkright,or otherintellectualpropertyrightrelatingtoanycombination,machine,orprocessinwhichTIcomponentsorservicesareused.Information publishedbyTIregardingthird-partyproductsorservicesdoesnotconstitutealicensetousesuchproductsorservicesorawarrantyor endorsementthereof.Useofsuchinformationmayrequirealicensefromathirdpartyunderthepatentsorotherintellectualpropertyofthe thirdparty,oralicensefromTIunderthepatentsorotherintellectualpropertyofTI. ReproductionofsignificantportionsofTIinformationinTIdatabooksordatasheetsispermissibleonlyifreproductioniswithoutalteration andisaccompaniedbyallassociatedwarranties,conditions,limitations,andnotices.TIisnotresponsibleorliableforsuchaltered documentation.Informationofthirdpartiesmaybesubjecttoadditionalrestrictions. ResaleofTIcomponentsorserviceswithstatementsdifferentfromorbeyondtheparametersstatedbyTIforthatcomponentorservice voidsallexpressandanyimpliedwarrantiesfortheassociatedTIcomponentorserviceandisanunfairanddeceptivebusinesspractice. TIisnotresponsibleorliableforanysuchstatements. Buyeracknowledgesandagreesthatitissolelyresponsibleforcompliancewithalllegal,regulatoryandsafety-relatedrequirements concerningitsproducts,andanyuseofTIcomponentsinitsapplications,notwithstandinganyapplications-relatedinformationorsupport thatmaybeprovidedbyTI.Buyerrepresentsandagreesthatithasallthenecessaryexpertisetocreateandimplementsafeguardswhich anticipatedangerousconsequencesoffailures,monitorfailuresandtheirconsequences,lessenthelikelihoodoffailuresthatmightcause harmandtakeappropriateremedialactions.BuyerwillfullyindemnifyTIanditsrepresentativesagainstanydamagesarisingoutoftheuse ofanyTIcomponentsinsafety-criticalapplications. Insomecases,TIcomponentsmaybepromotedspecificallytofacilitatesafety-relatedapplications.Withsuchcomponents,TI’sgoalisto helpenablecustomerstodesignandcreatetheirownend-productsolutionsthatmeetapplicablefunctionalsafetystandardsand requirements.Nonetheless,suchcomponentsaresubjecttotheseterms. NoTIcomponentsareauthorizedforuseinFDAClassIII(orsimilarlife-criticalmedicalequipment)unlessauthorizedofficersoftheparties haveexecutedaspecialagreementspecificallygoverningsuchuse. OnlythoseTIcomponentswhichTIhasspecificallydesignatedasmilitarygradeor“enhancedplastic”aredesignedandintendedforusein military/aerospaceapplicationsorenvironments.BuyeracknowledgesandagreesthatanymilitaryoraerospaceuseofTIcomponents whichhavenotbeensodesignatedissolelyattheBuyer'srisk,andthatBuyerissolelyresponsibleforcompliancewithalllegaland regulatoryrequirementsinconnectionwithsuchuse. TIhasspecificallydesignatedcertaincomponentsasmeetingISO/TS16949requirements,mainlyforautomotiveuse.Inanycaseofuseof non-designatedproducts,TIwillnotberesponsibleforanyfailuretomeetISO/TS16949. Products Applications Audio www.ti.com/audio AutomotiveandTransportation www.ti.com/automotive Amplifiers amplifier.ti.com CommunicationsandTelecom www.ti.com/communications DataConverters dataconverter.ti.com ComputersandPeripherals www.ti.com/computers DLP®Products www.dlp.com ConsumerElectronics www.ti.com/consumer-apps DSP dsp.ti.com EnergyandLighting www.ti.com/energy ClocksandTimers www.ti.com/clocks Industrial www.ti.com/industrial Interface interface.ti.com Medical www.ti.com/medical Logic logic.ti.com Security www.ti.com/security PowerMgmt power.ti.com Space,AvionicsandDefense www.ti.com/space-avionics-defense Microcontrollers microcontroller.ti.com VideoandImaging www.ti.com/video RFID www.ti-rfid.com OMAPApplicationsProcessors www.ti.com/omap TIE2ECommunity e2e.ti.com WirelessConnectivity www.ti.com/wirelessconnectivity MailingAddress:TexasInstruments,PostOfficeBox655303,Dallas,Texas75265 Copyright©2013,TexasInstrumentsIncorporated