Digital Signal Processing Reference
In-Depth Information
10.1.1 Using a Correlation Scheme and Onboard LEDs for
Verifying Detection
The correlation scheme is as follows. Let the input signal be u ( t )
=
A (sin(2
p
697 t
+
j 1 )
+
sin(2
p
1209 t
+j 2 )). Since the input signal includes sin(2
p
697 t
+j 1 ), the corre-
lation of the input signal with sin(2
p
697 t
+j 1 ) must be higher than the correlations
with sin(2
p
770 t
+j 1 ), sin(2
p
852 t
+j 1 ), and sin(2
p
941 t
+j 1 ). The Fourier transform
Ú
u ( t ) e - j w t dt has a peak at 697 Hz. Using Euler's formula for the exponential function,
it becomes a correlation of u ( t ) with sine and cosine functions. As a result, the input
frequency can be determined by correlating the input signal with the sine and cosine
for each possible frequency. The algorithm is as follows:
1. For each frequency, find the following correlations:
N
N
Â
Â
()
(
)
()
(
)
W
=
u t
sin
2
p
697
t
,
W
=
u t
cos
2
p
697
t
,
sin
697
n
n
cos
697
n
n
n
=
1
n
=
1
...
N
N
Â
Â
()
(
)
()
(
)
W
=
u t
sin
2
p
1477
t
,
W
=
u t
cos
2
p
1477
t
sin
1477
n
n
cos
1477
n
n
n
=
1
n
=
1
2. For each frequency, find the maximum between sine weight and cosine weight:
(
)
W
=
max
W
,
W
,
697
sin
697
cos
697
...
(
)
W
=
max
W
,
W
1477
sin
1477
cos
1477
3. Among the first four weights, choose the largest one; and among the last three
weights, choose the largest one:
(
)
WWWWW
W
=
max
,
,
,
,
1
697
770
852
941
(
)
=
max
WWW
,
,
2
1209
1336
1477
4. The frequencies present in the input signal can then be obtained. If both W 1
and W 2 , are larger than a threshold, turn on the appropriate LEDs corre-
sponding to each character, as shown in Table 10.2.
Figure 10.1 shows the C source program DTMF.c that can be completed readily.
Build this project as DTMF. You can test this project first since the complete exe-
cutable file DTMF.out is included on the CD in the folder DTMF. It can be tested
using one of the following:
Search WWH ::




Custom Search