DTMF Matlab1
DTMF Matlab1
\
| t
= 0 ,
2
cos
1
] [
where
b
f is the center frequency of the filter and
s
f is the sampling frequency,
both in Hz.
6. Write a MATLAB function named dtmfdetect.m, to implement a DTMF
encoder and decoder in a noisy environment. The requirements of the
dtmfdetect function are given as follows:
(i) The input to the function consists of one of the valid key names, filter
length of the band-pass filters and noise power. That is,
dtmfdetect(1,50,1) will generate a DTMF tone 1 with 50 = L and
the tone is corrupted by a zero-mean white Gaussian noise with power of
1. The output will show the result of the detection, namely, displaying a
message of The detected key is 1.
(ii) Each DTMF signal is the sum of a pair of unity amplitude sinusoidal
signals and the time duration is 0.2s with sampling frequency 8000 =
s
f .
(iii) To add a zero-mean white Gaussian noise to the noise-free DTMF tone,
you can use the randn command. An example of using randn is:
5
noise = sqrt(0.1)*randn(1,10);
where a zero-mean Gaussian noise sequence of length 10 with power of
1 0
2
. = o will be generated.
(iv) To detect the DTMF tone frequencies, you first need to pass the signal to
a filter bank of 7 band-pass filters whose center frequencies are 697 Hz,
770 Hz, 852 Hz, 941 Hz, 1209 Hz, 1336 Hz and 1477 Hz. The DTMF tone
can then be deduced from the two outputs with the largest energy. An
example of producing the output signal given the input and FIR filter
coefficients is
y=conv(x,h); % x is the input and h is the filter
% impulse response
An example of computing the energy of a signal is
energy = sum(y.*y);
Try your dtmfdetect function with various keys, different L ( 50 = L and 500 = L )
and noise powers ( 0
2
= o , 1
2
= o and 50
2
= o ). For each condition, perform 10 trials
and record the number of correct detection in the following table. For example, if the
DTMF tone is 1 and we detect 1 10 times at 50 = L and 0
2
= o , we write 10 in
the corresponding entry.
Key 50 = L
0
2
= o
500 = L
0
2
= o
50 = L
1
2
= o
500 = L
1
2
= o
50 = L
50
2
= o
500 = L
50
2
= o
1
2
3
4
5
6
7
8
9
0
*
#
References:
[1] E.Part-Enander, A.Sjoberg, B.Melin and P.Isaksson, The MATLAB Handbook,
Addison-Wesley, 1996
[2] D.Hanselman and B.Littlefield, Mastering MATLAB 7, Pearson Education
International, 2005
[3] http://www-h.eng.cam.ac.uk/help/tpl/programs/matlab.html
[4] www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/bqr_2pl.html
[5] L.Schenker, "Pushbutton Calling with a Two-Group Voice-Frequency Code,"
The Bell System Technical Journal, vol.39, no.1, pp.235255, 1960
[6] J.H.McClellan, R.W.Schafer and M.A.Yoder, Signal Processing First, Prentice-
Hall, 2003