Time Scope Measurements - MATLAB & Simulink Example - MathWorks India
Time Scope Measurements - MATLAB & Simulink Example - MathWorks India
Thisexampleshowshowtomeasureperformancecharacteristicsofapulsewidthmodulated
OpenThisExample
sinusoid.Theexamplecontainsamodelwhichyoucanmodifytoviewtheeffectsofparameter
changesonrisetime,falltime,overshoot,undershoot,pulsewidth,pulseperiod,anddutycycle
measurements.Theexamplealsoshowsanexampleofarisingedgetriggerandissetuptoperformbasicstatistical
operations(mean,median,RMS,maximum,minimum)andmeasurethefrequencyandperiodofthepulseperiodvia
cursorsandpeakfinding.
Theexamplemodelcontainsseveralmeasurementsandtheircorrespondingsetups.
Triggers
Thefirstsectionshowshowtouseatriggertostabilizeanoisysinusoidinthedisplay.Youcanseehowthesinusoid
isconstructedbydoubleclickingontheNoisySinusoidblock.
ThesinusoidalsignalisfedintoaTimeScopeblockwithtriggersenabled.
Youcanexperimentwiththetriggerpositionbydraggingthemarkersaroundthedisplay.Youcantriggeruponrisingor
fallingedges.Thisexampleincludes0.1Vofhysteresistohelpstabilizethesinusoidinthepresenceofnoise.The
hysteresisensuresthatthesignaltraversesatleast0.1Vbelowthetriggerlevelbeforeregisteringapositivegoing
transition.
Ifyouclosethetriggers,youwillseethatthesinusoidnolongerstaysfixedinthescreen.Youcanbringthetriggers
backbyclickingonthetriggericon.
MeasurementsofaPulseWidthModulatedSource
Inthisexample,apulsewidthmodulatedsourceisconnectedtoseveraltimescopesthatcontainmeasurements.
Youcanviewthesourcebyclickingonit:
Themodelconstructssinusoidalpulsewidthmodulationbyapplyingabiastothedesiredsinewaveandsubsequently
subtractingaperiodicsawtoothwave.Theresultingwaveformisthenfedintoacomparatortoformtheshapeofthe
pulse.Noiseisthenaddedtothesignalandthensenttoafilterwithanunderdampedresponse.
YoucanmodifytheamountofadditivenoiseontheinputbyclickingontheRandomSourceandmodifyingthe
varianceoftheGaussiandistribution.
Youcansimilarlymodifytheresponseofthefilterbychangingitscoefficients.
Transitions
YoucanviewsomebasicinformationabouttherisingandfallingtransitionsofthewaveformbyviewingtheTransitions
paneloftheBilevelMeasurementsdialog.
Viewingtheresults,youcanseethatthepulsehasahighvoltagelevelof+1Vandalowvoltagelevelof1V.
Theexampleabovecapturestworising(positive)edgesandtwofalling(negative)edgeswithrisetimesandfalltimes
ofaround340ns.Ifyouzoomintojustoneedgeofthewaveformyoucanseethemeasurementsforjustthatedge.
Notethattheedgesofthepulsesarefairlysteep,havingaslewrateofabout4V/us.Anunderdampenedfilterwas
usedtoachievethisrate.Changingthefiltertobeoverdampedwoulddecreasetherateatwhichtheedgeofeach
pulsecouldtransitionbetweenpulselevels.Theoutputofanunderdampenedfilterexhibitssignificantringing
immediatelyafterchangingbetweenlowandhighstates.Toquantifythisringingbehavior,youcanusethe
measurementsintheOvershoots/Undershootspanel.
OvershootandUndershoot
TheBilevelMeasurementsdialogalsocontainsmeasurementsthatrelatetoanunderdampedenvironment.Youcan
viewthetransitionaberrationsbyopeningtheOvershoots/Undershootspanel:
Theaverageovershootoftherisingedgesisabout42%.Theundershootis34%.Largeovershootscansometimes
damagelogicdeviceswhicharedesignedtoacceptonlyasmallvoltagerange.Largeundershootscancausedevices
todetectincorrectlogicstates.Inthisexamplethetransitionssettleonaveragewithin7.3microseconds.
Youcanreducetheamountofringingbyexperimentingwiththefiltercoefficientsattheoutputofthemodulated
source.
PulseCycles
YoucanalsoviewhowthepulsewidthanddutycyclevaryasfunctionsoftimebyopeningtheCyclespanelinthe
BilevelMeasurementsdialog:
Thisexampleshowsthreepositivepolaritypulsesbutonlytwonegativepolaritypulses.Thepulsefrequencyis10
kHz.Youcanobservetheencodedsinusoidbywatchinghowthedutycycleandpulsewidthchangeovertime.
PeakFinder
Alternatively,youcanmeasuretheamplitudesandthetimesofsignificantpeaksbyinvokingthePeakFinderdialog.
Thevoltageatthetipofeachovershootisabout1.8Vandthenextlargestringingcomponentofthefirstpulseisat
1.14V.
Expandthesettingspaneltochangethenumberofpeaksshown.Youcanalsofilterbasedonheightordistance
betweenpeaks.Youcanalsochangethetextannotationshowninthedisplay.
CursorMeasurements
Youcanmeasuretherelativedistancesbetweeneventsofthewaveformbyusingcursormeasurements.Herethe
cursorsareatthestartofeachpulseandconfirmthatthepulseperiodis10kHz.
Experimentwiththesettingstomovethecursorsanywhereonthescreenormeasurethelocationsofothersignals.
Youcanmovethecursorswiththearrowkeysandalsosnapthemtoeitherthenearestdatapointorscreenpixel.
SignalStatistics
YoucanviewbasicsignalstatisticsofthecapturedwavewiththeSignalsStatisticsmeasurementdialog.
Youcanobservetheminimumandmaximumvaluesofthedisplayedsignalandothersignalmetrics,suchasthe
peaktopeak,mean,median,andRMSvalues.
References
IEEEStd.1812003IEEEStandardonTransitions,Pulse,andRelatedWaveforms