experiment 2 b

Upload: kyle-hamilton

Post on 05-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Experiment 2 B

    1/5

    Experiment 2BAnalog to Digital Conversion and Sampling Rates

    1

    EXPERIMENT 2B

    EBU2 - 312

    A/D Conversion and Sampling Rates

    Prelab Questions: Having prepared for the lab experiment, including reviewingExperiment 1 and attending lecture, you will have to answer the followingquestions and turn them in with the prelab summary. All prelab submissions areindividual and to be computer-generated:

    1) Summarize your strategy for determining the resolution of the DAC.2) Theoretically speaking when analyzing the frequency spectrum of dolphin

    vocalizations, which may go up to 150 kHz, what is the lowest samplingfrequency necessary?

    3) In displaying a 100 Hz sine wave what do you ideally expect to see (e.g. ina perfect world) if you sampled at 100 Hz?

    4) In attempting to capture a 100 Hz signal, what frequencies would you findfor 10 Hz, 90 Hz and 110 Hz? (Hint: here is where aliasing becomes anissue).

    5) For a +5 volt to -5 volt range what is the resolution for an N-bit converter,where N = 10, 12, 14.

    Objectives

    1) To determine the resolution of the DAC / DAS ( digital-to-analogueconverter / digital to analog system, what comes out of the NationalInstrument 6251 unit ). Note for the DAS we are using the resolution of theDAC = the resolution of the ADC (analog-to-digital converter, what goesinto the NI-6251 unit)

    2) To investigate the importance of the sampling rate (reproducing a plot of asine wave already in the computer and also recording a signal, so as tocapture all its frequency components).

    Part I: DAC Resolution

    For an N-bit digital to analog converter (DAC) whose voltage range is b(volts) toa(volts), the RESOLUTION of the converter is given by the following relation:

  • 8/2/2019 Experiment 2 B

    2/5

    Experiment 2BAnalog to Digital Conversion and Sampling Rates

    2

    For example: 2-bit converter, with a range of 0 to 10 volts, has a resolution:

    (Note on semantics: For the DAC as the resolution gets bigger, themeasurements become more coarse and the DAC can not resolve small voltageincrements. On the other hand as the DAC resolution gets smaller, themeasurements become more accurate because smaller voltages can bemeasured. So resolution in the context of the DAC is different than say for amicroscope, where higher resolution implies you can resolve smaller things.)

    I. Set-up: Build the circuit in figure 1:

    NOTE: Connect two wires to the Data Acquisition System (DAS). This allows youaccess to the digital to analog converter in the DAS. Connect a White wire to thechannel AO0 analog output and a Black wire to AO Gnd. The other end of thewhite wire then is connected to AI0+ and the other end of the black wire toAI0-.

    II. Procedure: - Focus # 1a. Determine the RESOLUTION of the DAC installed inside your

    computer, i.e. what is the smallest voltage step that the computercan generate.

    b. Open the vi entitled: Generate voltageNB, and SteveDMM.Configure the Steve DMM.vi to the appropriate Device (Dev)number AI0 (Analog Input 0) via the Dev pull down menu (e.g.Dev1/ai0) and run the vi, and ensure that the Mode is set to DC

    Figure 1. Equipment arrangement for DAC resolution determination

  • 8/2/2019 Experiment 2 B

    3/5

    Experiment 2BAnalog to Digital Conversion and Sampling Rates

    3

    volts. NOTE: Device number refers to the DAS (use the Dev pulldown menu e.g. Dev1/ao0 or Dev2/ai0), channel number refers towhere you are connected on breakout board and will vary betweenexperiments.

    c. To select the voltage that you wish the computer to generate, enter

    voltage for analog output box, click on box, enter number, hit enterbutton on keyboard (or click on enter button on display). To run theprogram hit arrow button (under it).

    d. First, determine the DC offset of the system by entering zero Volts.The reading displayed on the DMM when the vi is generating zeroVolts is the DC offset. Record this number. You will need to add orsubtract it from the remainder of the readings for this configuration.

    e.g. if it is a -0.0002V you would add it to your actual reading, if it is+0.0002V you would subtract it from your actual reading).

    e. Next, determine the range of the system. Find the maximum andminimum Voltages that can be output by asking the vi to generatehigher and higher (or lower and lower) Voltages until the display onthe DMM no longer changes to match the requested output. Theseare you max and min Voltages.

    f. Create a table of possible Resolutions using equation (1) and 10,12, 16 and 18 as possible N values.

    g. Ask the vi to output these voltages starting from the smallest andworking your way up. Watch the DMM for changes. If the voltagedisplayed by the DMM changes in correspondence to the voltageoutput by the vi, that is the Resolution of your DAC.

    Question #1a: What is the smallest voltage increment that the DMM canread? (i.e. what is the resolution of the DMM and will this be adequate fordetermining the resolution of the DAC board in your computer?.

    Question #1b: What is the range of the DAC?

    Question #1c: What is the resolution of your DAC?

    Question #1d: What is N in equation for Resolution?

    Question #1e: Is it possible for the inherent noise of a DMM to affect yourestimate of the resolution of the DAC? Explain in terms of a simpleexample.

    III. Procedure: - Focus # 2a. Further explore the DAS resolution.

  • 8/2/2019 Experiment 2 B

    4/5

    Experiment 2BAnalog to Digital Conversion and Sampling Rates

    4

    b. Open the Generate VoltageNB and SteveDMM vis. Configure theDAS such that the output channel # is 0, and the input channel # is0 (from previous experiment).

    c. Connect the analog output for channel 0 (AO0 and AO Gnd) to theinput for channel 0 (AI0+AI0-). NOTE: In this configuration, the

    output of the computer is being sent directly back into thecomputer.d. In the Generate VoltageNB vi, input 0 volts and read the value at

    the SteveDMM. This is your offset value. Now input, starting at100microVolts in steps of 100microV (e.g.100, 200, 300, 400,500,600,700,800, 900,1000,1200,1300 MicroV). Record thecorresponding numbers in the SteveDMM vi. Plot a scatter plot ofthe results. Provide the plot in your report. (Open Excel, put yourdata into two columns, and then highlight the two columns, openthe Insert tab at the top of Excel, select the Scatter points graph).

    Part II: Sampling Rate: Sampling a Sine Wave

    I. Set-up: Build a circuit similar to the one in figure 2.

    II. Procedure:- Focus #3a. Open the virtual instrument (VI) entitled: sampling rateNB.vi.

    Configure the vi such that the input channel is Dev1/ai0 andSample Per Channel is 100.

    b. Connect a white wire from AO0 to Oscope Ch1 and AI0+. c. Connect a black wire from AO Gnd to Oscope ground lead and AI0. d. Open the Steve Waveform.vi.

    Figure 2. Equipment arrangement for Sampling Experiment

  • 8/2/2019 Experiment 2 B

    5/5

    Experiment 2BAnalog to Digital Conversion and Sampling Rates

    5

    e. Using the oscilloscope for verification, send a 100 Hz signal (sinewave) with peak-to- peak voltage of 2 volts to the DAS.

    f. Use the Sampling rate vi : Choose an appropriate SCAN TIME (xaxis), and sample the signal at a variety of samples per second(Hz.)NOTE: SCAN TIME refers to the time interval over which the

    signal is sampled. Also note the X and Y axis.

    Question #2:Do you get a good representation of the 100 Hz signal whenyou sample at 50 Hz? 100 Hz? 200 Hz? 1000 Hz? What seems best?Provide a plot of the sampled data and various sampling speeds,explaining your conclusions.

    Question #3: The period of the input analog signal is (close to) constant.As you increase the sampling rate, measure the time between severalsuccessive peaks in your sampled data. Does the time between the peakschange as you increase the sampling rate?

    Question #5:What happens when you increase the speed of the signal thatyou are trying to sample? What are the limits of the DAC board? (i.e. whatcan it reliably sample?) How about your oscilloscope? How fast a signalcan it reliably capture?

    Due next week: Experiment #2 Formal Report

    Motivational Questions should be explored in the report, we do not wantto see:

    Question 1: answer = blah blah,Question 2: answer = blah blah

    - Nicholas Busan, Steve Roberts & Rahul Kapadia (Oct 5 2011)