libspandsp 0.0.4
|
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <memory.h>
#include <string.h>
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/complex.h"
#include "spandsp/dds.h"
#include "spandsp/sig_tone.h"
Defines | |
#define | PI 3.14159265358979323 |
Functions | |
int | sig_tone_rx (sig_tone_state_t *s, int16_t amp[], int len) |
Process a block of received audio samples. | |
int | sig_tone_tx (sig_tone_state_t *s, int16_t amp[], int len) |
Generate a block of signaling tone audio samples. | |
sig_tone_state_t * | sig_tone_init (sig_tone_state_t *s, int tone_type, sig_tone_func_t sig_update, void *user_data) |
Initialise a signaling tone context. | |
Variables | |
sig_tone_descriptor_t | sig_tones [4] |
sig_tone_state_t* sig_tone_init | ( | sig_tone_state_t * | s, |
int | tone_type, | ||
sig_tone_func_t | sig_update, | ||
void * | user_data | ||
) |
Initialise a signaling tone context.
Initialise a signaling tone context.
s | The signaling tone context. |
tone_type | The type of signaling tone. |
sig_update | Callback function to handle signaling updates. |
user_data | An opaque pointer. |
References dds_phase_rate(), dds_scaling_dbm0(), sig_tone_state_t::desc, sig_tone_state_t::sig_update, sig_tone_descriptor_t::tone_amp, sig_tone_descriptor_t::tone_freq, and sig_tone_state_t::user_data.
int sig_tone_rx | ( | sig_tone_state_t * | s, |
int16_t | amp[], | ||
int | len | ||
) |
Process a block of received audio samples.
Process a block of received audio samples.
s | The signaling tone context. |
amp | The audio sample buffer. |
len | The number of samples in the buffer. |
References sig_tone_descriptor_t::broad_a, sig_tone_descriptor_t::broad_slugi, sig_tone_state_t::broad_z, sig_tone_state_t::desc, sig_tone_state_t::mown_notch, sig_tone_descriptor_t::notch_a1, sig_tone_descriptor_t::notch_lag_time, sig_tone_descriptor_t::notch_slugi, sig_tone_descriptor_t::notch_threshold, sig_tone_state_t::notch_z1, sig_tone_state_t::notch_zl, sig_tone_descriptor_t::sharp_flat_timeout, sig_tone_state_t::sig_update, sig_tone_descriptor_t::tone_off_check_time, sig_tone_descriptor_t::tone_on_check_time, sig_tone_descriptor_t::unfiltered_slugi, and sig_tone_state_t::user_data.
int sig_tone_tx | ( | sig_tone_state_t * | s, |
int16_t | amp[], | ||
int | len | ||
) |
Generate a block of signaling tone audio samples.
Generate a block of signaling tone audio samples.
s | The signaling tone context. |
amp | The audio sample buffer. |
len | The number of samples to be generated. |
References dds_mod(), sig_tone_state_t::desc, sig_tone_descriptor_t::high_low_timeout, sig_tone_state_t::sig_update, and sig_tone_state_t::user_data.