Sunteți pe pagina 1din 5

Experiment 2B Analog to Digital Conversion and Sampling Rates

EXPERIMENT 2B
EBU2 - 312

A/D Conversion and Sampling Rates


Prelab Questions: Having prepared for the lab experiment, including reviewing Experiment 1 and attending lecture, you will have to answer the following questions and turn them in with the prelab summary. All prelab submissions are individual 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 sampling frequency necessary? 3) In displaying a 100 Hz sine wave what do you ideally expect to see (e.g. in a perfect world) if you sampled at 100 Hz? 4) In attempting to capture a 100 Hz signal, what frequencies would you find for 10 Hz, 90 Hz and 110 Hz? (Hint: here is where aliasing becomes an issue). 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-analogue converter / digital to analog system, what comes out of the National Instrument 6251 unit ). Note for the DAS we are using the resolution of the DAC = the resolution of the ADC (analog-to-digital converter, what goes into the NI-6251 unit) 2) To investigate the importance of the sampling rate (reproducing a plot of a sine wave already in the computer and also recording a signal, so as to capture all its frequency components).

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

Experiment 2B Analog to Digital Conversion and Sampling Rates

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, the measurements become more coarse and the DAC can not resolve small voltage increments. On the other hand as the DAC resolution gets smaller, the measurements become more accurate because smaller voltages can be measured. So resolution in the context of the DAC is different than say for a microscope, where higher resolution implies you can resolve smaller things.) I. Set-up: Build the circuit in figure 1:

Figure 1. Equipment arrangement for DAC resolution determination NOTE: Connect two wires to the Data Acquisition System (DAS). This allows you access to the digital to analog converter in the DAS. Connect a White wire to the channel AO0 analog output and a Black wire to AO Gnd. The other end of the white wire then is connected to AI0+ and the other end of the black wire toAI0-. II. Procedure: - Focus # 1 a. Determine the RESOLUTION of the DAC installed inside your computer, i.e. what is the smallest voltage step that the computer can 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 2

Experiment 2B Analog to Digital Conversion and Sampling Rates volts. NOTE: Device number refers to the DAS (use the Dev pull down menu e.g. Dev1/ao0 or Dev2/ai0), channel number refers to where you are connected on breakout board and will vary between experiments. c. To select the voltage that you wish the computer to generate, enter voltage for analog output box, click on box, enter number, hit enter button on keyboard (or click on enter button on display). To run the program 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 zero Volts is the DC offset. Record this number. You will need to add or subtract 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 and minimum Voltages that can be output by asking the vi to generate higher and higher (or lower and lower) Voltages until the display on the DMM no longer changes to match the requested output. These are 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 and working your way up. Watch the DMM for changes. If the voltage displayed by the DMM changes in correspondence to the voltage output by the vi, that is the Resolution of your DAC. Question #1a: What is the smallest voltage increment that the DMM can read? (i.e. what is the resolution of the DMM and will this be adequate for determining 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 your estimate of the resolution of the DAC? Explain in terms of a simple example. III. Procedure: - Focus # 2 a. Further explore the DAS resolution.

Experiment 2B Analog to Digital Conversion and Sampling Rates b. Open the Generate VoltageNB and SteveDMM vis. Configure the DAS such that the output channel # is 0, and the input channel # is 0 (from previous experiment). c. Connect the analog output for channel 0 (AO0 and AO Gnd) to the input for channel 0 (AI0+AI0-). NOTE: In this configuration, the output of the computer is being sent directly back into the computer. d. In the Generate VoltageNB vi, input 0 volts and read the value at the SteveDMM. This is your offset value. Now input, starting at 100microVolts in steps of 100microV (e.g.100, 200, 300, 400, 500,600,700,800, 900,1000,1200,1300 MicroV). Record the corresponding numbers in the SteveDMM vi. Plot a scatter plot of the results. Provide the plot in your report. (Open Excel, put your data into two columns, and then highlight the two columns, open the 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.

Figure 2. Equipment arrangement for Sampling Experiment II. Procedure:- Focus #3 a. Open the virtual instrument (VI) entitled: sampling rateNB.vi. Configure the vi such that the input channel is Dev1/ai0 and Sample 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.

Experiment 2B Analog to Digital Conversion and Sampling Rates e. Using the oscilloscope for verification, send a 100 Hz signal (sine wave) with peak-to- peak voltage of 2 volts to the DAS. f. Use the Sampling rate vi : Choose an appropriate SCAN TIME (x axis), 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 when you 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 several successive peaks in your sampled data. Does the time between the peaks change as you increase the sampling rate? Question #5: What happens when you increase the speed of the signal that you are trying to sample? What are the limits of the DAC board? (i.e. what can it reliably sample?) How about your oscilloscope? How fast a signal can it reliably capture?

Due next week: Experiment #2 Formal Report Motivational Questions should be explored in the report, we do not want to see:

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

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

S-ar putea să vă placă și