Analog to Digital Conversion.docx

上传人:b****4 文档编号:24279153 上传时间:2023-05-26 格式:DOCX 页数:9 大小:40.80KB
下载 相关 举报
Analog to Digital Conversion.docx_第1页
第1页 / 共9页
Analog to Digital Conversion.docx_第2页
第2页 / 共9页
Analog to Digital Conversion.docx_第3页
第3页 / 共9页
Analog to Digital Conversion.docx_第4页
第4页 / 共9页
Analog to Digital Conversion.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

Analog to Digital Conversion.docx

《Analog to Digital Conversion.docx》由会员分享,可在线阅读,更多相关《Analog to Digital Conversion.docx(9页珍藏版)》请在冰豆网上搜索。

Analog to Digital Conversion.docx

AnalogtoDigitalConversion

AnalogtoDigitalConversion

SamerEl-Haj-Mahmoud

ElectronicsEngineeringTechnologyProgram

TexasA&MUniversity

Instructor’sPortion

Summary

ThepurposeofthislabistoprovidethestudentswithhandonexperienceinusingtheanaloginputsofaNationalInstrumentsdataacquisitioncard.ThelabassumesthatthestudentshavepriorexposuretoLabVIEW,andthattheyknowthebasicsofwritinganddebuggingLabVIEWVIs(VirtualInstruments).TheexperimentwillteachthemhowtoapplytheirLabVIEWknowledgetoacquireananalogsignalfromthefunctiongenerator.TheywilldisplayitinLabVIEWandcalculateitsRMSandaveragevalues.ThestudentsshouldhavestudiedAnalogtoDigitalconversiontheoryinclassbeforecomingtothelab.

TheobjectiveforthisexperimentisforthestudentstowritetheneededLabVIEWVItosampleananalogsignalanddisplayitonawaveformchartinLabVIEW.Theinstructionsprovidedinthestudent’ssectiondescribeastep-by-stepapproachtowritethebasicstructureoftheVI.Therestoftheimplementationislefttothestudents.TheVIprovidedisasampleimplementationandisintendedfortheinstructor’sreferenceuseandnotforthestudents.ThediagramcanbepasswordprotectedincasethestudentswanttolookatthefrontpanelandseehowtheVItheyarewritingshouldbehave.

Uses

Thisexperimentappliestogeneralinstrumentationandelectronicssystemsinterfacingcoursesinelectricalengineeringorengineeringtechnologyprograms.TheexperimentcanalsobeusefulinbasicLabVIEWcourses,teachingtheconceptsofanaloginputthroughdataacquisitioncards,inadditiontootherLabVIEWtechniquessuchastheuseofWaveformChartsandtheuseofstatisticalfunctionssuchasRMSandMean.

EquipmentList

∙PCrunningMSWindows(visit forrequirementsspecifictoyouroperatingsystem)

∙LabVIEWFullDevelopmentSystem

∙PCI1200DAQfromNationalInstruments(partnumber777386-01)

∙CB-50LPI/OConnectorBlockfromNationalInstruments(partnumber777101-01)

∙NBIRibbonCablefromNationalInstruments(partnumber180624-10)

∙TektronixTAS475FourChannelOscilloscope,oranygenerallabscopewith2ormorechannels.

∙HP3312AFunctionGenerator,oranygeneralfunctiongeneratorwithsinusoidalandsqaureoutputsignalsofvariablefrequency.

Setup

Followthestepslistedbelowtopreparetheworkstationforthisexperiment.Theinstructionsassumeyouareusingtheequipmentlistshownpreviously.

Note:

MostofthemanualsthatarereferredtoshipwithNationalInstrumentshardwareandsoftware.Ifyoucan’tfindyourhardcopyofthemanuals,youcangetthemonlineatIf youencounterproblemsduringsetup,contacttechnicalsupportat

BeforetheDayoftheLab

1.InstallLabVIEW(seetheLabVIEWReleaseNotesforyourversionofLabVIEW).

2.InstallyourPCI-1200board(seethePCI1200UserManual,oronlineat:

3.ConnecttheribboncabletothePCI1200cardandtotheI/Oconnectorblock.

OntheDayoftheLab

4.Powerupthecomputer.

5.StartLabVIEW.

6.Powerupthefunctiongenerator.

References

∙NI’swebsite:

∙Schweber,William.ElectronicCommunicationSystems.UpperSaddleRiver:

Prentice-Hall,1999;p292-3.

∙Burns,MarkandRoberts.AnIntroductiontoMixed-SignalICTestandMeasurement.TexasInstruments,2000;p.174.

Student’sPortion

Introduction

Inthisexperiment,youwillwriteaLabVIEWVItoacquireananalogsignalfromtheanaloginputpinsofthePCI1200DataAcquisitionCard(DAQ),displayitinLabVIEW,andcalculateitsRMSandaveragevalues.Youwillalsoshowtherelationshipofamplitudetonumberofaverages.ThislabrequiresbackgroundinanalogtodigitalconversionandtheconceptsofsamplingandNyquisttheorem.TheseconceptsaresummarizedintheTheorysectionofthisexperiment.

Objective

TolearnhowtouseLabVIEWforanaloginputthroughaDAQcard.

TolearnaboutAnalogtoDigitalconversionandhowtoacquireasignalanddisplayitinLabVIEW.

Tostudytheeffectofthesamplingfrequencyinanalogtodigitalconversion.

Theory

In1928,H.Nyquistshowedthatananalogsignalcouldbeperfectlyreconstructedsolelyfromitssamplevalues.Thiscouldbedonewithoutanylossofitsoriginalinformationifthesamplingrateisatleasttwicethebandwidthofthesignal,thusthefamousrule:

Nyquistsamplingrate=2xsignalbandwidth

Forexample,asignalwithabandwidthof1000Hzmustbesampledat2000ormoresamples/secondwithoutanylossofinformation.

Figure1.Sineandcosinewavessampledattwicethesignalfrequency

(Source:

Burns,MarkandRoberts.AnIntroductiontoMixed-SignalICTestandMeasurement)

Samplingatexactlytwicethesignalfrequencyisnotenoughinmostpracticalsituations.Figure1illustratesthisproblem:

“Asisevident,allthesamplesfromthesinewavearezerowhereasthosefromthecosinesignalarenot.Clearly,anyinformationcontainedinthesinewavesuchasitsamplitudewouldbelostandunobtainablefromthesamples.WecanthereforeconcludethatoneshouldnotattempttosampleatexactlytwicetheNyquistrate”

(Source:

Burns,MarkandRoberts.AnIntroductiontoMixed-SignalICTestandMeasurement,P.174)

Thisiswhyasamplingrateasmuchas10timesthesignalbandwidthisusedwhendoingananologtodigitalconversion.

QuantizationErrors

Thetermquantizationerror(orquantizationnoise)isusedtodescribethefactthatadigitalvaluecancorrespondtoadistinctspanofanalogsignals.AnyanalogsignalwithinthezoneofoneLSBwillhavethesamedigitalvalueandthereforelookidenticaltoallothersaftertheanalog-to-digitalprocess.Itisthissmalldegreeoferrorinmisrepresentationthatisknownasquantizationerror.Inordertocloselyreconstructtheoriginalanalogsignal,theanalogtodigitalconversionprocessneedstominimizethequantizationerrorasmuchaspossible.Toreducethequantizationerror,moredivisions(higherresolution)shouldbeusedtorepresenttheanalogvalue.Forthisexperiment,thistypeoferrorisminimizedbythefactthatthePCI1200boardsuseadevicewithrelativelygoodresolution(12-bits).

Figure2.QuantizationError

(Source:

Schweber,William.ElectronicCommunicationSystems.p287)

Figure2,presentstheideathattheoriginalanalogsignal(a)canberepresentedinvaryingdegreesofresolutiontherebydeterminingtheamountofquantizationerrorincluded.Atwo-bitrepresentationasin(b)hasmorequantizationerrorthanthethree-bitrepresentationin(c).Infact,witheveryincreasingbitofresolution,quantizationerroriscutinhalf.

Pre-LabPreparation

Readthisexperimentbeforecomingtothelab.YoushouldunderstandtheconceptsofsamplingandquantizationerrorsandstudytheNyquisttheorem.

Bringthefollowingtolabwithyou:

∙Thisexperiment.

∙Yourlabnotebookandpencil.

∙2virus-freeformatted3.5-inchfloppydisks(alwaysmakeabackupcopyofyourcodeontheseconddisk).

Answerthefollowingquestionsinthedatasheetprovidedattheendofthisexperimentbeforecomingtothelab.Remembertoincludetheseanswersinyourlabreporttoo.

1.WhatarethepinnumbersforanalogoutputandanaloginputonthePCI1200DAQcard?

Howmanychannelsarethereforanaloginputandanalogoutput?

2.WhichVIisusedtoreadtheanalogsignalfromtheanaloginputpin?

3.WhichVIscalculatetheRMSandmeanvaluesofasignal?

WorkstationDetails

Yourworkstationshouldhavethefollowingitems:

∙ComputerwithNationalInstrumentsLabVIEWsoftware

∙NationalInstrumentsDAQboard(insidethecomputer)

∙NationalInstrumentsDAQboardterminalblock

∙TektronixOscilloscope.

∙HP3312AFunctionGenerator.

LabProcedure

1.StartanewVIinLabVIEW.Youshouldthenaddthefollowingcontrolsandindicatorstothefrontpanel:

a.Start/StopSwitch:

ThisisthemainOn/OffswitchfortheVI.

b.NumberofReadingsDigitalControl:

ThisvaluewillbeusedtocontrolthemainloopoftheVI.

c.NumberofSamplesperReadingDigitalControl:

ThisVIwilldeterminethenumberofbufferedsamplesforeachreadingfromtheanaloginput.

d.SampleRateDigitalControl:

ThisvaluewillconfigurethesamplingrateoftheanaloginputontheDAQ.

e.WaveformoftheAcquiredSignal:

Thischartwilldisplaytheacquiredanalogsignal.Itshouldmatchthesignalobtainedontheoscilloscopewhenmeasuredfromthefunctiongenerator.

f.RMSvalueDigitalIndicator:

YouwilldisplaytheRMSvalueofeachbufferedinputoftheacquiredsignal.

g.MeanvalueDigitalIndicator:

Youwilldisplaythemeanvalueofeachbufferedinputfromtheacquiredsignal.

h.AverageDCValueDigitalIndicator:

YouwilldisplaytherunningaverageDCvalue(averageofthemeanvalues)fortheentireacquiredsignal.

2.TheVIissupposedtoworkasfollows:

itreadsananalogsignalbyacquiringanumberof“samples”atacertain“samplingrate”(bufferedinput).Theacquiredsignal,alongwiththemeanandRMSvaluesofthosesamplesaredisplayedonthefrontpanel.Then,theprocessrepeats.Eachiterationoftheloopiscalledone“reading”.ItisalsorequiredtodisplaytheaverageDCvalue(averageofmeansforallreadings).

3.Afteraddingthosecontrols,startwiringtheVIdiagramswiththecontrolstoimplementthefunctionalityofyourprogram.YoumightfindthefollowingVIsusefulinyourcode:

a.Amainloop,bestimplementedasaForLoopstructure,whichwillbecontrolledbytheStart/Stopswitchandthenumberofreadingsdigitalcontrol.

b.AnAnalogInp

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1