New version page

# UD ELEG 212 - Sinusoids in MATLAB and VAB

Pages: 8
Documents in this Course

7 pages

58 pages

Unformatted text preview:

ELEG-212 Signals and Communications 1/8 Lab 1: Sinusoids in MATLAB and VAB 1 Overview The goal of this laboratory is gain familiarity with complex numbers and their use in representing sinusoidal signals as complex exponentials. Manipulating sinusoid functions using complex exponentials turns trigonometric problems into simple arithmetic and algebra. In this lab you will be using MATLAB to represent, manipulate, and plot real and complex sinusoidal signals. You will also begin to work with the VAB (Visual Application Builder) software, which is an interface for the TMS320c62x DSP board. The DSP board enables real-time acquisition, manipulation, display, and output of signals. 2 Procedures 2.1 Sinusoids in VAB We begin this laboratory by introducing the VAB software. This is a high-level interface for the TMS320c62x DSP board. As a means of introduction, three exercises will be performed: • Generation, visual plotting, and output of sinusoids. Through this exercise, the constructive and destructive interference of two sinusoidal signals will be demonstrated. • Generation of sinusoids with similar frequencies will be used to demonstrate beat patterns. • Acquisition capabilities of the DSP boards will be used to measure the frequency of a Tuning Fork. Note that a VAB overview is attached at the end of this laboratory as an appendix. Please read this overview prior to completing the following components. 2.1.1 Single Sinusoid Generation After starting the VAB software, open the worksheet Plotting Cos.Lst. This worksheet should be on the desktop of your computer. After opening the worksheet, you should see the window at the right.ELEG-212 Signals and Communications 2/8 The blocks that the make up the worksheet are: Icon Function Cosine block – generates a cosine wave with the amplitude, frequency and phase specified by the sliders below it. Speaker block – outputs the signal through the speakers. Buffer block – buffers and outputs a specified number of the input samples. Trigger buffer – buffers input data when the selected trigger criteria is met. In the VAB environment, double clicking on a block shows the details of its function. Procedure (a) Press the Run button: . Initially the frequency is set to 100 Hz. Try adjusting the amplitude slider. Can you hear the 100 Hz cosine? You might have to turn your speakers up. Many of the small computer speakers don’t pass frequencies as low as 100 Hz. Turn the frequency up with the frequency slider. What is the minimum frequency that you hear a tone? If you have a good audio system, you should be able to produce audible output as low as 20 Hz. Frequencies below 20 Hz are not audible, but they can be felt. (b) What is the maximum frequency that you can hear or the system can output? Normal human hearing has an upper limit of 20 KHz. This is higher than that DSP board can output. (c) Try adjusting the phase slider. What happens? Can you hear a difference? Why or why not? The rightmost buffer is a trigger buffer. It will not pass a signal on to the display until it is triggered. It’s set to trigger whenever the data changes from negative to positive. Have you noticed that the plots always start at zero? (d) Align the speakers in a straight line and separate them by a fixed distance. Run the VAB worksheet. Make sure to set the sinusoidal parameters so that the output is audible. Move a few steps away from the speakers and walk parallel to the speaker alignment. What do you observe? Can you hear the constructive and destructive interference produced by the two speakers? Can you describe and explain this phenomenon?ELEG-212 Signals and Communications 3/8 2.1.2 Observation of Beats Open Beats.lst. You should see the window below. The blocks that make up the work sheet are the same as the ones we used for the previous exercise. These blocks are available in the real time blocks library, as well as the simulation library. For this exercise, the blocks from the simulation library should be utilized. Procedure (a) Press the Run button. The frequencies of the two cosine functions are set to similar values. The two sinusoids are added and output through the speakers. Listen to the sound. What do you observe? What can you infer from the output seen in the display block? (b) Can you hear the beats? Derive the equation of the output waveform and predict the frequency of the beat wave.ELEG-212 Signals and Communications 4/8 2.1.3 Measuring the Parameters of a Tuning Fork Open Measuring Tuning fork.lst. You should see: The blocks are the same as the first two experiments, with the exception of the microphone block. The microphone block is simply used to acquire audio signals, in this case the vibration of the tuning fork. Procedure (a) Press the Run button. Push the Mic/Cos button so it says Microphone. Tap the tuning fork so that it makes a noise. Note that hitting it on your hand or knee is fine. But do not strike it on fixed objects, such as the table. Hold the tuning fork by the microphone and observe the waveform on the display. Does it look like a cosine? If not, strike it again? If you strike it on a hard surface it will vibrate at other modes and not have a single frequency sinusoidal structure. (b) Press the Stop button and measure the period of the tuning fork. Fill in the table below. You can get a rather accurate measure of the period by click on one of the peaks. The time and amplitude of that peak will appear. Now click on the next peak. Make sure the two peak values are about the same. If they are, subtract the times to obtain the period. Does the frequency match the frequency on the tuning fork? (c) Press Run again and toggle the Mic/Cos button to Cosine. Adjust the Amplitude and Frequency of the cosine generator to match the tuning fork. Do they sound the same? Amplitude Frequency PhaseELEG-212 Signals and Communications 5/8 2.2 Sinusoids in Matlab In this part, we extend our use of MATLAB to represent sinusoids with different amplitudes, frequencies, and phases. Complex representations will be utilized and real and imaginary parts extracted. 2.2.1 Representation of Sinusoids with Complex Exponentials In Matlab consult help on exp, real and imag. (d) Generate the signal 0()()jtxt Aeωφ+= for 3A=, 0.4φπ=− , and 02 (1250)ωπ= . Take a range for t that will cover 2 or 3 periods. (e) Plot the real part versus t and the imaginary part versus t. Use

View Full Document