tone_detect.h File Reference

Go to the source code of this file.

Classes

struct  goertzel_descriptor_t
struct  goertzel_state_t

Functions

void make_goertzel_descriptor (goertzel_descriptor_t *t, float 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.
void goertzel_reset (goertzel_state_t *s)
 Reset 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.


Detailed Description


Function Documentation

goertzel_state_t* goertzel_init ( goertzel_state_t s,
goertzel_descriptor_t t 
)

Initialise the state of a Goertzel transform.

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

void goertzel_reset ( goertzel_state_t s  ) 

Reset the state of a Goertzel transform.

Parameters:
s The Goertzel context.
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 context
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 context
amp The samples to be transformed
samples The number of samples
Returns:
The number of samples unprocessed


Generated on Tue Jul 24 11:29:29 2007 for libspandsp by  doxygen 1.5.2