AN2384 Freescale Semiconductor / Motorola, AN2384 Datasheet - Page 22

no-image

AN2384

Manufacturer Part Number
AN2384
Description
Generic Tone Detection Using Teager-Kaiser Energy Operators on the StarCore SC140 Core
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Using the DTMF Detector
velocity), so that the size is equal to the time between two checks / 93
whether a key has been detected after each call, using an input buffer that is less than 93 ms long, and clear the
variables in case of success. In both cases, you should add some margin to the output vector size since the 93 ms
value is recommended by the Q.24 norm, but it may be lower.
22
Generic Tone Detection Using Teager-Kaiser Energy Operators on the StarCore SC140 Core, Rev. 1
#include <stdio.h>
#include <stdlib.h>
#include "fsl_dtmf_det.h"
#define
void load_samples(fract16 samples, int channel); //external function
int i, j, channel, len;
FILE *txid;
short samples[SIZE_BUF];
#pragma align samples 8
UINT8 buffer[SIZE_BUF * 2];
DTMF_detector_data dtmf_channel[2];
#pragma align dtmf_channel 8
UINT8 detected_keys[4];
UINT16 *p_num_dtmf_digits;
char dtmf_key[16] = {
};
char s[] = "Detected DTMF key _.\n";
void
main ()
{
}
for (i = 0; i < SIZE_BUF * 2; i++) {
}
while (1) {
}
buffer[i] = 0;
samples[i >> 1] = 0;
for (channel = 0; channel < 2; channel++) {
}
'1', '2', '3', 'A',
'4', '5', '6', 'B',
'7', '8', '9', 'C',
'*', '0', '#', 'D'
printf ("\n\n*** Generic Tone Detection on StarCore SC140 ***\n\n");
printf ("DTMF test: \n\n");
fsl_dtmf_det_init (&dtmf_channel[0]);
fsl_dtmf_det_init (&dtmf_channel[1]);
}
load_samples(samples,channel);
fsl_dtmf_det
p_num_dtmf_digits = (UINT16 *) (&dtmf_channel[channel] + 46);
if (*p_num_dtmf_digits) {
SIZE_BUF
for (j = 0; j < *p_num_dtmf_digits; j++) {
}
*p_num_dtmf_digits = 0;
s[18] = dtmf_key[0xf & (detected_keys[j] - 1)];
printf ("%s", s);
(samples,
800
detected_keys
10–3. Alternatively, you can check
,
&dtmf_channel[channel],
Freescale Semiconductor
SIZE_BUF
);

Related parts for AN2384