One objective in this lab is to learn how to use the Fast Fourier Transform (FFT) capabilities of the oscilloscope to analyze the frequency content of signals. The other objective is to learn how to use the A/D and D/A capabilities in the labs. Finally, the design project for this course will be introduced.
A formal report is not required for this lab. However, there are some calculations related to FFT measurements that I would like you to submit before you leave lab today. I would expect the calculations to take approximately one page per group.
Begin by connecting the function generator to the oscilloscope. Set the function generator to produce a sine wave with amplitude 100 mV and frequency 1 kHz. Display the sine wave on the oscilloscope, and save this "time-domain" view of the signal as setup 1 using the SETUP key on the scope.
Now we can display the sine wave in the "frequency domain" using the FFT as follows. First, press the 1 key and turn the time-domain display of the sine wave OFF. Press the +/- key, then turn FUNCTION 2 to ON, then choose the FFT operation. (Note that the scope will also perform differentiation and integration operations.) Familiarize yourself with the various items that can be specified for the FFT display. Settings that work for the 100 mV, 1 kHz sine wave are as follows: 10 dB Units/div, 10 dBV Reference Level, and on the FFT MENU: Hanning Window, Frequency Span 9.766 kHz (change with Time/Div knob and the knob next to SETUP button), and Move 0 Hz to left. Save this "frequency-domain" view of the signal as setup 2. Now you can view signals in the time-domain by recalling setup 1, and setup 2 will produce a frequency-domain view of the signal.
Please do the following exercises.
Frequency (Hz) | 1209 | 1336 | 1477 |
697 | 1 | 2 | 3 |
770 | 4 | 5 | 6 |
852 | 7 | 8 | 9 |
941 | * | 0 | # |
The FFT is an important and useful tool to analyze the frequency content of signals. You should now be able to use the oscilloscope to perform the FFT operation.
Note: The DTMF code is for wireline phones. You may want to test your cell phone to see what tones are used when you dial.
Analog-to-digital (A/D) and digital-to-analog (D/A) conversion circuits are important in the analysis of signals and systems. The computers in Dana 307 contain Keithley A/D and D/A cards (Dana 303 and CC 4 also have similar cards). I would like you to know how to use these cards with Matlab in case you need them for your design project in this course.
The following procedure is used for the Keithley cards.
>> ai=analoginput('keithley')The getsample command will get one sample. The getdata command will get a vector of NS samples. It is usually not necessary to use both commands.
>> addchannel(ai,1)
>> set(ai,'SampleRate',fs)
>> set(ai,'SamplesPerTrigger',NS)
>> start(ai)
>> data=getdata(ai);
>> point=getsample(ai);
>> stop(ai)
>> delete(ai)
The following Matlab function conveniently combines these commands:
get_sig.mTo run this function, save the get_sig.m file in your folder. Then from the Matlab command window, you can type, for example,
>> x = get_sig(2000, 4000);This will get 4,000 samples from the A/D card with sampling rate 2,000 samples per second.
>>ao=analogoutput('keithley')The putsample command will set the output to a constant value of level volts. The putdata command will output the data vector. It is usually not necessary to use both commands.
>>addchannel(ao,1)
>>set(ao,'SampleRate',Fs)
>>putsample(ao,level)
>>putdata(ao,data)
>>start(ao)
You can also use the soundcard on the PC to sample and output signals. These are most convenient for audio signals. You can access the soundcard from Matlab with the commands
>>ai=analoginput('winsound')Try to record a sentence using the soundcard and microphone, and then play the sound back at twice and one-half the original sampling frequency.
>>ao=analogoutput('winsound')
Browse Lab 6 and begin to formulate ideas for your design project. I will ask you to describe your plans in lab on November 1-2.
Thank you.