tone_detect.h File Reference

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_tgoertzel_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_tdtmf_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_tbell_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_tr2_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.


Detailed Description


Function Documentation

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.

Parameters:
s The Bell MF receiver context.
amp The audio sample buffer.
samples The number of samples in the buffer.
Returns:
The number of samples unprocessed.

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.

Parameters:
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.
Returns:
A pointer to the Bell MF receiver context.

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.

Parameters:
s The DTMF receiver context.
amp The audio sample buffer.
samples The number of samples in the buffer.
Returns:
The number of samples unprocessed.

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.

Parameters:
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.
Returns:
A pointer to the 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.

Parameters:
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.

Parameters:
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.

Parameters:
s The Goertzel state. If NULL, a state is allocated with malloc.
t The Goertzel descriptor.
Returns:
A pointer to the Goertzel state.

float goertzel_result ( goertzel_state_t s  ) 

Evaluate the final result of a Goertzel transform.

Parameters:
s The Goertzel state
Returns:
The result of the transform.

int goertzel_update ( goertzel_state_t s,
const int16_t  amp[],
int  samples 
)

Update the state of a Goertzel transform.

Parameters:
s The Goertzel state
amp The samples to be transformed
samples The number of samples
Returns:
The number of samples unprocessed

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.

Parameters:
s The R2 MF receiver context.
amp The audio sample buffer.
samples The number of samples in the buffer.
Returns:
The number of samples unprocessed.

r2_mf_rx_state_t* r2_mf_rx_init ( r2_mf_rx_state_t s,
int  fwd 
)

Initialise an R2 MF receiver context.

Parameters:
s The R2 MF receiver context.
fwd TRUE if the context is for forward signals. FALSE if the context is for backward signals.
Returns:
A pointer to the R2 MF receiver context.


Generated on Fri Nov 10 09:40:25 2006 for libspandsp by  doxygen 1.5.1