Files
osmocom-analog/src/common/dtmf.h
Andreas Eversberg 7e45f556ce Correcting all levels and move all remaining integer samples to sample_t
The leves are based on the standards of each mobile network. They
are adjusted to the specified frequency deviation now.
2017-02-18 21:01:13 +01:00

15 lines
497 B
C

typedef struct dtmf {
int samplerate; /* samplerate */
char tone; /* current tone to be played */
int pos; /* sample counter for tone */
int max; /* max number of samples for tone duration */
double phaseshift65536[2]; /* how much the phase of sine wave changes per sample */
double phase65536[2]; /* current phase */
} dtmf_t;
void dtmf_init(dtmf_t *dtmf, int samplerate);
void dtmf_set_tone(dtmf_t *dtmf, char tone);
void dtmf_tone(dtmf_t *dtmf, sample_t *samples, int length);