You are on page 1of 2

1

ECE 218 Signals and Systems Laboratory 10

I. P REPARATION 1209 Hz 1336 Hz 1477 Hz


1) Find the Fourier transform of the following signals
by hand.
a) x(t) = cos( 2 t) 697 Hz 1 2 ABC 3 DEF
b) x(t) = sin( 3 t) + cos( 4 t)
c) x(t) = sin( 4 t) + (t 1)

2) Discrete time signals are produced from the


continuous time signals via sampling. Sampling is the 4 GHI 5 JKL
770 Hz 6 MNO
process of taking samples from a continuous time signal
periodically. This period is called the sampling period.
Given the continuous time signal xc (t) the discrete
time signal x[n] is obtained by x[n] = xc (nTs ) where
n is integer and Ts is the sampling period. T1s is called 7 PRS
852 Hz 8 TUV 9 WXY
the sampling frequency.

3) Now consider the DTMF pad in Fig. 1. The


continuous time sinusoidal signal are expressed in
time domain. For instance, the digit 5 is expressed
as d5(t) = sin(2770t) + sin(21336t). Computer 941 Hz * 0 #
uses digital data. Hence, continuous time signals are
converted to discrete time signals before processing.
The DTMF tones are converted to discrete via
Fig. 1. DTMF tones.
sampling. For example, d5 in discrete time is
d5[n] = sin(2770nTs +sin(21336nTs ) where Ts
is the sampling frequency. Its values is usually 8kHz
in speech waveforms. However, different sampling The table that shows angular DTMF frequencies
frequencies are used. As the sampling frequency when sampling at 8192Hz is performed is shown in
increases (means that you take more samples from Fig. 2.
continuous time signal) you have better digital signal.
If your sampling frequency is lower than a specific 5) Now create vectors for all the digits in DTMF
threshold value than your digital signal cannot resemble pad. Use sampling frequency 8192. Choose your time
the properties of your continuous time signal. The interval as 0:999. Listen the signal using the sound
sampling frequency should be at least higher than command. For example, sound(d5,8192).
twice the highest frequency available in your signal.
Otherwise you have a bad discrete time signal. 6) The matlab command fft is used to find
the discrete time Fourier transforms of both
4) Assuming that the continuous waveforms aperiodic and periodic discrete time signals. The
are sampled at 8192Hz. The digit 5 is periodic signal is truncated for fft calculation.
represented by the discrete time signal. d5[n] = Fourier transform of a discrete Ptime aperiodic
sin(2770n/8192 + sin(21336n/8192) which equals signal is found using X(w) =
jwn
x[n]e .
d5[n] = sin(0.5906n) + sin(1.0247n) Now inspect the This is computed in matlab (fft) using the
following matlab program. PM 1 j2kn/N
X(wk ) = n=0 x[n]e , k = 0 N 1.
x[n] is nonzero for 0 n M 1 and wk = 2k N .
n=0:999; Now inspect the following matlab code.
d5=sin(0.5906*n)+sin(1.0247*n)
sound(d5,8192); n=-1000:1000;
d5=sin(0.5906*n)+sin(1.0247*n);
N=5000;
Prepared by Orhan Gazi who is with Electronics and Communica-
tion Engineering Department, Cankaya University, Ankara, Turkiye (e-mail: ft=(fft(d5,N));
o.gazi@ari.cankaya.edu.tr). omega=linspace(0,2*pi,N);
2

0.9273 1.0247 1.1328 d5=sin(0.5906*n)+sin(1.0247*n);


N=5000; ft=(fft(d5,N));
omega=linspace(0,2*pi,N);
plot(omega,abs(ft));
0.5346 1 2 ABC 3 DEF omega(find(abs(ft)==max(abs(ft))))

As you see the above code gives the dtmf frequency,


by looking at the dtmf table you can identify the digit
number.
0.5906 4 GHI 5 JKL 6 MNO
II. E XPERIMENTAL W ORK
1) Write a matlab program that takes 7 telephone digits
from the user and produces the tones in a vector. Use
100 samples of silence between tones and use 1000
0.6535 7 PRS
8 TUV 9 WXY samples for the tones.

2) Write a function named ttdecode which accepts as


its input a touch tone signal in the format in part (1)
0.7217 * 0 # and returns as its output a 7 element vector containing
the phone numbers. For example, if the vector phone
contained the touch tones for the following 555-7319,
you should get the following output in matlab main
Fig. 2. DTMF tones. window.

testout=ttdecode(phone);
plot(omega,abs(ft)); testout
testout= 5 5 5 7 3 1 9
So, we understand that if a dtmf tone is received
we can identify the tone frequency by plotting to the
Fourier transform of it and looking at the impulse
locations on the frequency axis.

7) Define space to be a row vector with 100 samples of


silence using zeros. Define the phone to be your phone
number by appending the appropriate signals and space.
For instance, if your phone number was 555-7319, you
would type,
phone=[d5 space d5 space d5 space d7 space d3 space
d1 space d9];

8) If you chose your frequency axis as w


you should use fftshift command after fft computation.
Inspect the following matlab code,

n=-1000:1000;
d5=sin(0.5906*n)+sin(1.0247*n);
N=5000;
ft=fftshift(fft(d5,N));
omega=linspace(-pi,pi,N);
plot(omega,abs(ft));

9) Assume that you receive a dtmf tone, can you


determine the digit that belongs to that tone. Inspect
the following matlab code

n=-1000:1000;

You might also like