lab2final

13
ECE 410 Communication Systems Lab 2: A/Ds, D/As, and Nyquist

Upload: pavel-zaytsev

Post on 03-Oct-2015

214 views

Category:

Documents


1 download

DESCRIPTION

communication systems lab, digital to analog

TRANSCRIPT

ECE 410 Communication SystemsLab 2: A/Ds, D/As, and Nyquist

Pavel Zaytsev and Chris Stapler February 23, 2015Lab Instructor: Dr. SonekI. Purpose:In this lab we explored analog-to-digital (A/D) converters and digital-to-analog (D/A) convertors. The first component of this lab investigates how analog signal digitization affects the original signal. The latter component, digital-to-analog, primarily focuses on recreating our original signal. The objectives below highlight the major milestones of this lab.Objectives: Constructing the analog-to-digital circuit. Manipulation of our analog signal Constructing the digital-to-analog circuit Connecting the A/D circuit to the D/A circuit Adding the transimpedance amplifier Corrupting the signal

II. Formulas and Pertinent Information: A. Frequency of oscillation 1. (2.1)2. (2.2)a) This is recommend AD0804 clock frequency calculation.B. Clock Period: 1. (2.3)2. (2.4)a) LSB is the Least Significant BitC. Nyquist Theorem: If the highest frequency component, in hertz, for a given analog signal is fmax. Then according to the Nyquist Theorem, the sampling rate must be at least 2fmax, or twice the highest analog frequency component.III. Equipment: OscilloscopeProtoboard (contains power supply and basic signal generator)Signal GeneratorMicrochips: (1) AD0804 (Analog-to-Digital), (1) DAC0808 (Digital-to-Analog), (1) 741 Operational Amplifier, (1) 7486 Exclusive-Or GateResistors: (3) 10K ohms, (3) 5.1K ohmsCapacitors: (1) 220 picofarad, (1) 0.1 microfaradWires (test leads and hookup wiring)

IV. Introduction:1. Analog to Digital Conversion:Big picture wise, the importance of A/D conversion is monumental in how we interact with our modern world. By converting from the analog world to the digital world we can begin to use electronics to interface to the analog world around us. In relation to this lab, the A/D conversion occurs in the AD0804 microchip. The chip receives an input voltage and outputs a digital code which ideally represents the original analog signal. There are limitations, such as Nyquists Theorem (see Pertinent Information), that have to be considered in order to create an accurate representation of the signal. However, A/D conversion, when done properly, allows us to record, quantify, recreate, and interact with our world. 2. Digital to Analog Conversion: After reading about A/D conversion (above) you can intuitively understand what D/A conversion is. D/A conversion allows the user to take a seemingly meaningless string of 0s and 1s and convert it into a variety of analog representations such as music, video, or even mechanical motion (robots). This analogization occurs when the D/A microchip assigns a weight value to the binary code. The combination of these weighted values produces the analog signal. 3. Wow factor and food for thought: While the process seems simple, it's important to understand that digital-to-analog conversion (or vice versa) is actually conversion of usually two states (binary) to a theoretically infinite number of states (analog).

V. Procedure and Results:Analog to Digital CircuitA. Our first task is to construct the analog to digital circuit and observe the output. The signal generator will provide our analog signal in the form of voltage input. As a fail-safe, to confirm a functional circuit, we will attach the output to LEDs and be able to visually confirm proper circuit operation. B. Relevant chip and circuit data. 1. The AD0804 provides 8 bits of quantization which is 256 levels of resolution.2. The chip can be driven by a free-running clock. We constructed an oscillator to provide the clock itself. See Figure 1 for schematic. In our case, we used a 10k resistor and a 220 picofarad for the oscillator. a) Using equation (2.2) this would ideally give us a calculated clock frequency of 413K Hz. B. We constructed the A/D circuit (see Figure 1) and connected pins 11-18 to LEDs on our protoboard. The LED output would give us visual confirmation that the circuit was functioning properly (or not functioning). Figure 1: A/D Circuit

C. The circuit was powered with a 2v Peak-to-Peak, 50% symmetry, 1mHz (adjustable from 1mHz to 100Hz) ramp wave. Once powered, we observed that the LEDs were correctly counting up meaning that the LED lights visually represented a binary count that was increasing by +1 for every conversion. D. Clock frequency and conversion speed: 1. We attached the oscilloscope to pin 4 to measure the clock frequency. The actual clock frequency is needed in order to gauge the microchips conversion speed. Our actual frequency 273K Hz was very different from our calculated. See Table 1.2. Using the actual clock frequency we were able to determine the clock period and determine how many clock cycles are necessary for a full conversion (equation 2.3 and 2.4). A full conversion is how long it takes the least significant bit to change (+1 in this case). This isn't dependant on actual time but is a reflection of the speed of the chip.

Table 1: AD0804 Clock Frequency and Conversion CyclesClock Frequency (calculated)413.2K Hz

Clock Frequency (measured)273K Hz

Clock Period (calculated)

Conversion cycles needed (calculated)66.8 cycles

Digital-to-Analog CircuitA. We are now ready to convert our digital signal back to an analog signal. Ideally the new analog signal will be indistinguishable from the original input analog signal. The binary output from the A/D circuit will provide the input to our DAC. Potential problems we may encounter are aliasing and corruption, however is we monitor the input frequency we should be able to adjust the frequency input to stay within acceptable parameters. B. The A/D circuit was now connected to the D/A chip. See Figure 2 for the circuit diagram. a. The 8 binary outputs were disconnected from the LEDs and connected to the DAC0808 from Pins 5-12 (MSB to LSB respectfully).b. The 741 Operational Amplifier is used as a transimpedance amplifier which converts current to voltage allowing us to view the DAC output as voltage. c. A 4 volt sinusoid was applied to Vsig. (Frequency selected explained later).C. DAC Output: Once the oscilloscope showed that we were generating an analog signal from the D/A microchip we manipulated the frequency in order to find out the microchip limits when converting (see Table 2). From visual observation and inspection of input versus output frequencies, we determined we could have accurate conversion up to 400 Hz. After 400 Hz we noticed apparent aliasing. (See Figures 3 and 4 for example of no aliasing and aliasing).D. Using a TTL clock signal: In this experiment we disabled the RC clock components and attempted to use a TTL (0 to 5 volts) clock at pin 4 of the AD0804. We knew that our RC oscillator provided a 273K Hz clock cycle so our expectation was that a TTL signal of roughly the same frequency would provide similar output.a. New Inputi. A 4 volt amplitude 2k Hz acted as the input to the AD0804 (pin 6)ii. TTL clock input attached to pin 4 of AD0804b. Results: Almost all of the output sinusoids were unacceptable either due to gross stepping or clipping of the sinusoid. i. See Figures 5-9.ii. Notice in Figures 7-9 we begin to have serious clipping on the top side of the sinusoid. This most likely reflects an issue with the transimpedance amplifier and its (voltage/current) limitations.c. Elaboration on Results: This is the part I failed at. During the lab the results, specifically why the output failed to make an acceptable sinusoid, seemed to make sense, however when writing this report I cant seem to make sense of it. (Ive spent some time online research and cant find anything that really tackles this issue.) Current speculations are that an RC oscillator provides a much more stable clock than a TTL input signal. This makes sense because while TTL is digital, the input method is essentially an analog format. This could easily cause distortion and allow noise which would affect the clock cycle. (Again this is speculation and I will hopefully remember to ask about this during the next lab.)

Table 2: Conversion and AliasingSignal Frequency (produced by signal generator, Hz)Input Frequency (measured on oscilloscope, Hz)Output Frequency (measured on oscilloscope, Hz)Ratio(Output/Input)

600599566.944

500500472.944

4004004041.01

300299398.997

10099.799.3.996

*As you can see, past 400 Hz there is a significant change in the ratio. We believe that was an acceptable instrumentation/circuit error but past 400 Hz we began to notice significant changes. We attempted to identify exactly where between 400-500 Hz that aliasing began to occur but could not pinpoint the exact cutoff frequency.

Figure 2: D/A Circuit (right) Connected to A/D circuit (left) and the Transimpedance Amplifier (bottom)

Figure 3: DAC Output at 100 HzFigure 4: DAC Output at 567 Hz

Figure 5: TTL Clock at 100k HzFigure 6: TTL Clock at 500K Hz

Figure 7: TTL Clock at 1.5MHz Figure 8: TTL Clock at 2.5MHz

Figure 9: TTL Clock at 3.5MHz

Corruption of BitsA. Here we used an exclusive-or gate (7486 XOR) to corrupt the input to our DAC. The XOR gate inverts the binary input from the AD converter meaning if the input was a 0 then the DAC would actually receive a 1. a. The original RC oscillator was established in the AD circuit.b. A 2K Hz sinusoid with a 0.5V amplitude was the input signal at Vsig. B. We performed this experiment on the LSB (pin 18 on the AD0804) and the MSB (pin 11 on the AD0804).a. Pin 18 or pin 11 connected to the XOR input whose output would connect to the corresponding input gate on the DAC0808 (pin 12 for LSB and pin 5 for the MSB).b. With a corrupted LSB we were unable to notice any difference, however the corruption of the MSB lead to drastic changes (see figure 10).C. When the MSB was corrupted we attempted to find a frequency (ranging from 1mHz to 100K HZ) that was most resistant to corruption however we were unable to locate any frequency that met this condition.

Figure 10: Corruption of MSB with an XOR Gate

VI. Conclusions:A. A/D conversion, while a powerful tool, depends on adherence to Nyquists Theorem. If sampling rates occur at lower than 2x the maximum analog frequency (fmax) then the data will be faulty. B. There should always be verification of theoretical versus actual values for circuit components. As mentioned earlier we had a discrepancy by a factor of two for our oscillator frequency. C. Ideally an ADC followed by a DAC should replicate the exact analog input signal (input for the AD) however this proved to not be the case for our DAC output. I believe this was primarily due to the level of resolution available for the AD0804 or DAC0808. Higher levels of resolution may provide a smoother and more accurate signal. D. The corruption of bits provided an interesting and noteworthy insight on how greatly one corrupt bit may or may not impact the signal. While the significance between the LSB and MSB is obvious (in determining how they affect the signal), Im curious on whether there is a distinction between how the MSB and LSB is determined. If so, it leads to conclusions that corruption checking would have a huge impact if one could decide which input to always have a error check on. Meaning, could a chip check the most important inputs while ignoring the least important (this is a compromise between accuracy and speed)? E. At least