Lab 4: Using the CODEC ECE 2060 Spring, 2016 Haocheng Zhu Gregory Ochs Monday 12:40 15:40 Date of Experiment: 03/28/16 Date of Submission: 04/08/16
Abstract This lab covers the use of the CODEC that is necessary in nearly all of the future labs. Students will be instructed on how to configure the CODEC and how to use it to do AD/DA conversions. In this lab, students would use the CODEC on the DE2 board to examine basic signals from the benchtop function generator in both the analog and digital domain. In addition, students also would observe an audio signal from an MP3 player and send in an analog signal into the DE2 board and observe the converted digital waveform in Signal Tap II. Introduction The purpose of this lab was to explore the functionality of the CODEC, how to configure the CODEC and how to use it to do AD/DA conversions. The CODEC is a useful tool in converting digital to analog or analog to digital signals. In the lab, students work with the use of the CODEC on the DE2 board to examine basic signals from the benchtop function generator in both the analog and digital domain. In Part 2, students use the CODEC to observe an audio signal from an MP3 player or the ipad. In the third part, team will send in an analog signal into the DE2 board and observe the converted digital waveform in Signal Tap II. When displaying the wave on the oscilloscope, the output signal is being converted to analog. However, to display the data on Signal Tap, the information is being converted to digital. This is done through periodic sampling of the analog wave from the frequency generator.
Equipment and Procedures During this lab there were three sections, the first where the team used the CODEC to create a sine wave and a square wave on the oscilloscope, the second where the team viewed the wave pattern of a song from the the analog input on the oscilloscope, and finally the third part where the team used Signal Tap to plot a digital waveform. Part 1. During this part, the team took a given project that contained a CODEC and set the circuit up to output the input, allowing the input waveform to be seen on the oscilloscope. The team used the signal generator to output a sine wave and a square wave, and the oscilloscope displays of these can be seen in Figure 1 and Figure, respectively. The team was also asked to plot the oscilloscope data in MATLAB, and the resulting plots can be seen in Figure 2 and Figure 4. Part 2. In the second part, the team plugged a mp3 player into the 3.5mm jack, and this produced the waveform of the music on the oscilloscope. Unfortunately, the team did not save the oscilloscope screenshot of this output. Part3. Finally, in the last part of the lab, the team changed the circuit so the left and right digital outputs were left connected to blank output pins. This allowed the team to view the resulting wave in Signal Tap, and this can be seen in Figure 5.
Experiment Results Figure 1. Figure 2.
Figure 3. Figure 4.
Figure 5. Discussion Topic 1: What is the sampling frequency of the CODEC? The sampling frequency of the codec is 1 over the sampling period. Topic 2: What frequency should the signal generator be set at to achieve a normalized frequency f = 0.5? 24kHz. Topic 3: Explain why the units of the normalized frequency are in cycles/sample. In other words, what does it mean to have a signal that oscillates at 1/3 cycles/sample? What is the relationship between actual frequency, normalized frequency and cycles per sample. The reason why the normalized frequency is cycles per sample is because the equation is normalized frequency is equal to frequency/sample rate. The sampling rates units are samples per second and the frequency is cycles per seconds. The seconds cancel each other out leaving cycles per sample.
Topic 4: Use the circuit you developed in part 3 of the lab to find at what normalized frequency do you begin to stop seeing a signal? Set your function generator to 2 V peak peak. Figure out the frequency in Hertz at which Signal Tap stops reproducing a signal. Then divide by the sampling frequency to calculate the normalized frequency. Remember that F = f*fs (Assume Fs = 48,000 Hz). What you are examining is referred to as aliasing and the Nyquist criteria for sampling. Hint: Use Autorun Analysis to change the frequency and observe the signal in real time. A normalized frequency do we begin to stop seeing a signal would be between 1/2 and 1/2. Topic 5: CODEC stands for Encoding and Decoding. How are each of these functions accomplished at the hardware level? The codec is an analog to digital decoder and a Digital to analog converter at the same time. The Codec encodes and decodes analog audio or digital audio signals between 20Hz and 20kHz.
Conclusion After this lab, students have understood all of the details about CODEC. At first, we have learned that how to draw a CODEC block graph and how to use signal generator to make a wave. What s more, when input a song from our own cell phones into the board, we notice that the amplitude increases when we turn up the song s volume and declines when we turn down the song s volume. Finally, we have learned how to generate wave with signal tap. Acknowledgements All group members participated equally on the lab. Each member had a hand in writing and editing the report.