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?nd 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 speci?c
instructions,
Corrections to the Lab,In the?rst 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?le into Matlab,type,
>> cd /mit/6.003/data
>> load touch
Alternatively you can obtain the data?le from the course web page,
Basic Problems
(a) Create the ten di?erent 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?le 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 |D
2
(e
j?
)| and |D
9
(e
j?
)|,
(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?le as speci?ed
above,Do not get touch.mat?le 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 |D
8
(e
j?
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 <function> 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?nd 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
,
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?nd 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 speci?c
instructions,
Corrections to the Lab,In the?rst 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?le into Matlab,type,
>> cd /mit/6.003/data
>> load touch
Alternatively you can obtain the data?le from the course web page,
Basic Problems
(a) Create the ten di?erent 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?le 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 |D
2
(e
j?
)| and |D
9
(e
j?
)|,
(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?le as speci?ed
above,Do not get touch.mat?le 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 |D
8
(e
j?
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 <function> 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?nd 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
,