#include <stdio.h>#include <inttypes.h>#include <stdlib.h>#include <string.h>#include "spandsp/telephony.h"#include "spandsp/logging.h"#include "spandsp/complex.h"#include "spandsp/vector_float.h"#include "spandsp/complex_vector_float.h"#include "spandsp/async.h"#include "spandsp/dds.h"#include "spandsp/power_meter.h"#include "spandsp/v27ter_tx.h"Defines | |
| #define | CARRIER_NOMINAL_FREQ 1800.0f |
| #define | V27TER_TRAINING_SEG_1 0 |
| #define | V27TER_TRAINING_SEG_2 (V27TER_TRAINING_SEG_1 + 320) |
| #define | V27TER_TRAINING_SEG_3 (V27TER_TRAINING_SEG_2 + 32) |
| #define | V27TER_TRAINING_SEG_4 (V27TER_TRAINING_SEG_3 + 50) |
| #define | V27TER_TRAINING_SEG_5 (V27TER_TRAINING_SEG_4 + 1074) |
| #define | V27TER_TRAINING_END (V27TER_TRAINING_SEG_5 + 8) |
| #define | V27TER_TRAINING_SHUTDOWN_END (V27TER_TRAINING_END + 32) |
| #define | PULSESHAPER_2400_GAIN (19.972065748f/20.0f) |
| #define | PULSESHAPER_2400_COEFF_SETS 20 |
| #define | PULSESHAPER_4800_GAIN (4.9913162900f/5.0f) |
| #define | PULSESHAPER_4800_COEFF_SETS 5 |
Functions | |
| int | v27ter_tx (v27ter_tx_state_t *s, int16_t amp[], int len) |
| Generate a block of V.27ter modem audio samples. | |
| void | v27ter_tx_power (v27ter_tx_state_t *s, float power) |
| Adjust a V.27ter modem transmit context's output power. | |
| void | v27ter_tx_set_get_bit (v27ter_tx_state_t *s, get_bit_func_t get_bit, void *user_data) |
| Change the get_bit function associated with a V.27ter modem transmit context. | |
| int | v27ter_tx_restart (v27ter_tx_state_t *s, int rate, int tep) |
| Reinitialise an existing V.27ter modem transmit context. | |
| v27ter_tx_state_t * | v27ter_tx_init (v27ter_tx_state_t *s, int rate, int tep, get_bit_func_t get_bit, void *user_data) |
| Initialise a V.27ter modem transmit context. | |
| int | v27ter_tx_release (v27ter_tx_state_t *s) |
| Release a V.27ter modem transmit context. | |
| int v27ter_tx | ( | v27ter_tx_state_t * | s, | |
| int16_t | amp[], | |||
| int | len | |||
| ) |
Generate a block of V.27ter modem audio samples.
Generate a block of V.27ter modem audio samples.
| s | The modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples to be generated. |
| v27ter_tx_state_t* v27ter_tx_init | ( | v27ter_tx_state_t * | s, | |
| int | rate, | |||
| int | tep, | |||
| get_bit_func_t | get_bit, | |||
| void * | user_data | |||
| ) |
Initialise a V.27ter modem transmit context.
Initialise a V.27ter modem transmit context.
| s | The modem context. | |
| rate | The bit rate of the modem. Valid values are 2400 and 4800. | |
| tep | TRUE is the optional TEP tone is to be transmitted. | |
| get_bit | The callback routine used to get the data to be transmitted. | |
| user_data | An opaque pointer. |
| void v27ter_tx_power | ( | v27ter_tx_state_t * | s, | |
| float | power | |||
| ) |
Adjust a V.27ter modem transmit context's output power.
Adjust a V.27ter modem transmit context's power output.
| s | The modem context. | |
| power | The power level, in dBm0 |
| int v27ter_tx_release | ( | v27ter_tx_state_t * | s | ) |
Release a V.27ter modem transmit context.
Release a V.27ter modem transmit context.
| s | The modem context. |
| int v27ter_tx_restart | ( | v27ter_tx_state_t * | s, | |
| int | rate, | |||
| int | tep | |||
| ) |
Reinitialise an existing V.27ter modem transmit context.
Reinitialise an existing V.27ter modem transmit context, so it may be reused.
| s | The modem context. | |
| rate | The bit rate of the modem. Valid values are 2400 and 4800. | |
| tep | TRUE is the optional TEP tone is to be transmitted. |
| void v27ter_tx_set_get_bit | ( | v27ter_tx_state_t * | s, | |
| get_bit_func_t | get_bit, | |||
| void * | user_data | |||
| ) |
Change the get_bit function associated with a V.27ter modem transmit context.
Change the get_bit function associated with a V.27ter modem transmit context.
| s | The modem context. | |
| get_bit | The callback routine used to get the data to be transmitted. | |
| user_data | An opaque pointer. |
1.5.2