Go to the source code of this file.
Classes | |
struct | goertzel_descriptor_t |
struct | goertzel_state_t |
struct | dtmf_rx_state_t |
struct | bell_mf_rx_state_t |
struct | r2_mf_rx_state_t |
Defines | |
#define | _TONE_DETECT_H_ |
#define | MAX_DTMF_DIGITS 128 |
Functions | |
void | make_goertzel_descriptor (goertzel_descriptor_t *t, int freq, int samples) |
Create a descriptor for use with either a Goertzel transform. | |
goertzel_state_t * | goertzel_init (goertzel_state_t *s, goertzel_descriptor_t *t) |
Initialise the state of a Goertzel transform. | |
int | goertzel_update (goertzel_state_t *s, const int16_t amp[], int samples) |
Update the state of a Goertzel transform. | |
float | goertzel_result (goertzel_state_t *s) |
Evaluate the final result of a Goertzel transform. | |
dtmf_rx_state_t * | dtmf_rx_init (dtmf_rx_state_t *s, void(*callback)(void *user_data, const char *digits, int len), void *user_data) |
Initialise a DTMF receiver context. | |
void | dtmf_rx_set_realtime_callback (dtmf_rx_state_t *s, void(*callback)(void *user_data, int signal), void *user_data) |
Set a realtime callback for a DTMF receiver context. | |
void | dtmf_rx_parms (dtmf_rx_state_t *s, int filter_dialtone, int twist, int reverse_twist) |
Adjust a DTMF receiver context. | |
int | dtmf_rx (dtmf_rx_state_t *s, const int16_t *amp, int samples) |
Process a block of received DTMF audio samples. | |
int | dtmf_get (dtmf_rx_state_t *s, char *buf, int max) |
bell_mf_rx_state_t * | bell_mf_rx_init (bell_mf_rx_state_t *s, void(*callback)(void *user_data, const char *digits, int len), void *user_data) |
Initialise a Bell MF receiver context. | |
int | bell_mf_rx (bell_mf_rx_state_t *s, const int16_t *amp, int samples) |
Process a block of received Bell MF audio samples. | |
int | bell_mf_get (bell_mf_rx_state_t *s, char *buf, int max) |
r2_mf_rx_state_t * | r2_mf_rx_init (r2_mf_rx_state_t *s, int fwd) |
Initialise an R2 MF receiver context. | |
int | r2_mf_rx (r2_mf_rx_state_t *s, const int16_t *amp, int samples) |
Process a block of received R2 MF audio samples. |
int bell_mf_rx | ( | bell_mf_rx_state_t * | s, | |
const int16_t * | amp, | |||
int | samples | |||
) |
Process a block of received Bell MF audio samples.
Process a block of received bell MF audio samples.
s | The Bell MF receiver context. | |
amp | The audio sample buffer. | |
samples | The number of samples in the buffer. |
bell_mf_rx_state_t* bell_mf_rx_init | ( | bell_mf_rx_state_t * | s, | |
void(*)(void *user_data, const char *digits, int len) | callback, | |||
void * | user_data | |||
) |
Initialise a Bell MF receiver context.
s | The Bell MF receiver context. | |
callback | Callback routine used to report received digits. | |
user_data | An opaque pointer which is associated with the context, and supplied in callbacks. |
int dtmf_rx | ( | dtmf_rx_state_t * | s, | |
const int16_t * | amp, | |||
int | samples | |||
) |
Process a block of received DTMF audio samples.
Process a block of received DTMF audio samples.
s | The DTMF receiver context. | |
amp | The audio sample buffer. | |
samples | The number of samples in the buffer. |
dtmf_rx_state_t* dtmf_rx_init | ( | dtmf_rx_state_t * | s, | |
void(*)(void *user_data, const char *digits, int len) | callback, | |||
void * | user_data | |||
) |
Initialise a DTMF receiver context.
s | The DTMF receiver context. | |
callback | Callback routine used to report received digits. | |
user_data | An opaque pointer which is associated with the context, and supplied in callbacks. |
void dtmf_rx_parms | ( | dtmf_rx_state_t * | s, | |
int | filter_dialtone, | |||
int | twist, | |||
int | reverse_twist | |||
) |
Adjust a DTMF receiver context.
s | The DTMF receiver context. | |
filter_dialtone | TRUE to enable filtering of dialtone, FALSE to disable, < 0 to leave unchanged. | |
twist | Acceptable twist, in dB. < 0 to leave unchanged. | |
reverse_twist | Acceptable reverse twist, in dB. < 0 to leave unchanged. |
void dtmf_rx_set_realtime_callback | ( | dtmf_rx_state_t * | s, | |
void(*)(void *user_data, int signal) | callback, | |||
void * | user_data | |||
) |
Set a realtime callback for a DTMF receiver context.
s | The DTMF receiver context. | |
callback | Callback routine used to report the start and end of digits. | |
user_data | An opaque pointer which is associated with the context, and supplied in callbacks. |
goertzel_state_t* goertzel_init | ( | goertzel_state_t * | s, | |
goertzel_descriptor_t * | t | |||
) |
Initialise the state of a Goertzel transform.
s | The Goertzel state. If NULL, a state is allocated with malloc. | |
t | The Goertzel descriptor. |
float goertzel_result | ( | goertzel_state_t * | s | ) |
Evaluate the final result of a Goertzel transform.
s | The Goertzel state |
int goertzel_update | ( | goertzel_state_t * | s, | |
const int16_t | amp[], | |||
int | samples | |||
) |
Update the state of a Goertzel transform.
s | The Goertzel state | |
amp | The samples to be transformed | |
samples | The number of samples |
int r2_mf_rx | ( | r2_mf_rx_state_t * | s, | |
const int16_t * | amp, | |||
int | samples | |||
) |
Process a block of received R2 MF audio samples.
Process a block of received R2 MF audio samples.
s | The R2 MF receiver context. | |
amp | The audio sample buffer. | |
samples | The number of samples in the buffer. |
r2_mf_rx_state_t* r2_mf_rx_init | ( | r2_mf_rx_state_t * | s, | |
int | fwd | |||
) |
Initialise an R2 MF receiver context.
s | The R2 MF receiver context. | |
fwd | TRUE if the context is for forward signals. FALSE if the context is for backward signals. |