MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6.003: Signals and Systems-Fall 2003 COMPUTER LAB 2 Issued: October 7. 2003 Due: November 6. 2003 Background: To prepare yourself for these exercises, you may find it useful to look over the discussion of the functions fft and fftshift. at the start of Section 5. 1 on page 90 Problems to be handed in: In this lab, you will complete the Basic and Advanced Ex- ercises for the Telephone Touch-Tone problem considered in Section 5.2 on pages 93-96 of Buck, Daniel, and Singer(BDS). For all of the exercises, please include your MATLAB code with your name typed in the code. As stated in the General Information Sheet, we do not expect a formal lab report, but it is still important that you present your results clearly and in an organized manner. Included below are items to be turned in, along with more specific instructions Corrections to the Lab: In the first paragraph on page 93 of BDs, it says that the continuous-time waveform is sampled at 8192 kHz". This is incorrect, and should be 8192 Hz as stated in the caption to Figure 5.1 To load the appropriate data file into Matlab, type >>cd /mit/6.003/data >>load touch Alternatively you can obtain the data file from the course web page Basic problems (a)Create the ten different tones as indicated, but do not turn anything in for this part On some Linux machines, you may want to use sound instead of sound. You can get the M file at course web site or you may want to add a path on MIT server by typing > path(path, '/mit/6.003/data; ' (b) Turn in plots of )D2(eu)I and I Dg(eJu) (c) Generate your phone number as indicated, but do not turn anything in for this part
MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6.003: Signals and Systems—Fall 2003 Computer Lab 2 Issued: October 7, 2003 Due: November 2003 Background: To prepare yourself for these exercises, you may find it useful to look over the discussion of the functions fft and fftshift, at the start of Section 5.1 on page 90. Problems to be handed in: In this lab, you will complete the Basic and Advanced Exercises for the Telephone Touch–Tone problem considered in Section 5.2 on pages 93–96 of Buck, Daniel, and Singer (BDS). For all of the exercises, please include your Matlab code with your name typed in the code. As stated in the General Information Sheet, we do not expect a formal lab report, but it is still important that you present your results clearly and in an organized manner. Included below are items to be turned in, along with more specific instructions: Corrections to the Lab: In the first paragraph on page 93 of BDS, it says that the “continuous-time waveform is sampled at 8192 kHz”. This is incorrect, and should be 8192 Hz as stated in the caption to Figure 5.1. To load the appropriate data file into Matlab, type: >> cd /mit/6.003/data >> load touch Alternatively you can obtain the data file from the course web page. Basic Problems (a) Create the ten different tones as indicated, but do not turn anything in for this part. On some Linux machines, you may want to use sound2 instead of sound. You can get the M file at course web site or you may want to add a path on MIT server by typing >> path(path,’/mit/6.003/data;’) (b) Turn in plots of |D2(ej�)| and |D9(ej�)|. (c) Generate your phone number as indicated, but do not turn anything in for this part. 6
***Intermediate problems *** (d-e) Read through these exercises so that you will understand the later exercises. However, do not implement anything for these parts. In addition, get the data file as specified above. Do not get touch. mat file from Math Works ftp site. In the advanced exercises you will write functions which segment a signal into the various tones and automatically determine the digits advanced problems (f) Turn in a list of indices k and the corresponding wk which you found to be the closest to each of the touch-tone frequencies (g) Turn in a list of the values of D8(ewk)2 for each value of wk that you determined in (h-i)Consider these two parts to be one exercise. Write the function ttdecode as described in part(h), but do not assume that the signal consists of 1000 samples for each digit separated by 100 samples of silence. Instead, write your function to handle the more have varying lengths). Turn in the phone numbers that you get for the signals.y general case as described in part(i)(i.e. the touch-tone signals and silences may x2, hardx1, and hardx2. Make sure to turn in your MATLAB code for your function ttdecode, along with the code for any supporting functions Special Instructions: Since you are required to listen to several signals in this lab, we request that you use headphones while in the public MIT server clusters. If you decide to work in the lab, headphones are not required but may be advisable due to the noisy environment. For information about using headphones with the workstations, read the instructions given out with Computer Lab #1 Useful MATLAB Functions help: All of the functions listed below have help pages within MATLAB that can be viewed by typing help from the MATLAB command prompt abs: Finds the magnitude of a vector. Thus if you have a complex signal called X, then you could get the magnitude using abs(X) find: On parts(h-i) you have to split a signal into the separate tones. One MATLAB function that may be useful to do this find. It will return the indices of a vector which satisfy a given conditional statement. For example > index find(abs(x1)>0) This will find the indices of the vector x1 which have magnitude greater than zero You can then imagine looking for large gaps in the values of this index vector because gaps will indicate the end of one tone and the start of another. This is one possible solution which is acceptable for this lab. In practice, this approach would not be very
***Intermediate Problems*** (d–e) Read through these exercises so that you will understand the later exercises. However, do not implement anything for these parts. In addition, get the data file as specified above. Do not get touch.mat file from MathWorks ftp site. In the advanced exercises, you will write functions which segment a signal into the various tones and automatically determine the digits. Advanced Problems (f) Turn in a list of indices k and the corresponding �k which you found to be the closest to each of the touch–tone frequencies. (g) Turn in a list of the values of |D8(ej�k )| 2 for each value of �k that you determined in part (f). (h–i) Consider these two parts to be one exercise. Write the function ttdecode as described in part (h), but do not assume that the signal consists of 1000 samples for each digit separated by 100 samples of silence. Instead, write your function to handle the more general case as described in part (i) (i.e. the touch–tone signals and silences may have varying lengths). Turn in the phone numbers that you get for the signals x1, x2, hardx1, and hardx2. Make sure to turn in your Matlab code for your function ttdecode, along with the code for any supporting functions. Special Instructions: Since you are required to listen to several signals in this lab, we request that you use headphones while in the public clusters.If you decide to work in the lab headphones are not required but may be advisable due to the noisy environment. For information about using headphones with the workstations, read the instructions given out with Computer Lab #1. Useful MATLAB Functions: help: All of the functions listed below have help pages within MATLAB that can be viewed by typing help from the MATLAB command prompt. abs: Finds the magnitude of a vector. Thus if you have a complex signal called X, then you could get the magnitude using abs(X). find: On parts (h-i) you have to split a signal into the separate tones. One MATLAB function that maybe useful to do this find. It will return the indices of a vector which satisfy a given conditional statement. For example: >> index = find(abs(x1)>0); This will find the indices of the vector x1 which have magnitude greater than zero. You can then imagine looking for large gaps in the values of this index vector because gaps will indicate the end of one tone and the start of another. This is one possible solution which is acceptable for this lab. In practice, this approach would not be very robust. MIT server