spandsp
3.0.0
|
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include <stdio.h>
#include "spandsp/stdbool.h"
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/fast_convert.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/bitstream.h"
#include "spandsp/complex.h"
#include "spandsp/vector_float.h"
#include "spandsp/complex_vector_float.h"
#include "spandsp/vector_int.h"
#include "spandsp/complex_vector_int.h"
#include "spandsp/modem_echo.h"
#include "spandsp/async.h"
#include "spandsp/power_meter.h"
#include "spandsp/arctan2.h"
#include "spandsp/dds.h"
#include "spandsp/crc.h"
#include "spandsp/complex_filters.h"
#include "spandsp/v29rx.h"
#include "spandsp/v34.h"
#include "spandsp/private/bitstream.h"
#include "spandsp/private/logging.h"
#include "spandsp/private/power_meter.h"
#include "spandsp/private/modem_echo.h"
#include "spandsp/private/v34.h"
#include "v22bis_tx_rrc.h"
#include "v34_tx_2400_rrc.h"
#include "v34_tx_2743_rrc.h"
#include "v34_tx_2800_rrc.h"
#include "v34_tx_3000_rrc.h"
#include "v34_tx_3200_rrc.h"
#include "v34_tx_3429_rrc.h"
#include "v34_local.h"
#include "v34_tables.h"
#include "v34_superconstellation_map.h"
#include "v34_convolutional_coders.h"
#include "v34_probe_signals.h"
#include "v34_shell_map.h"
#include "v34_tx_pre_emphasis_filters.h"
Macros | |
#define | complex_sig_set(re, im) complex_setf(re,im) |
#define | complex_sig_t complexf_t |
#define | FP_Q9_7_TO_F(x) ((float) x/128.0f) |
#define | EQUALIZER_DELTA 0.21f |
#define | EQUALIZER_SLOW_ADAPT_RATIO 0.1f |
#define | V34_TRAINING_SEG_1 0 |
#define | V34_TRAINING_SEG_4 0 |
#define | V34_TRAINING_END 0 |
#define | V34_TRAINING_SHUTDOWN_END 0 |
#define | INFO_FILL_AND_SYNC_BITS 0x4EF |
#define | TRAINING_SCALE(x) (x) |
#define | TRAINING_AMP 10.0f |
#define | SH_PLUS_NO_SH_SYMBOLS 32 |
Typedefs | |
typedef float | tx_shaper_t[9] |
Enumerations | |
enum | { TRAINING_TX_STAGE_NORMAL_OPERATION_V34 = 0, TRAINING_TX_STAGE_NORMAL_OPERATION_CC = 1, TRAINING_TX_STAGE_PARKED } |
Functions | |
int | v34_get_mapping_frame (v34_tx_state_t *s, int16_t bits[16]) |
int | v34_tx (v34_state_t *s, int16_t amp[], int max_len) |
Generate a block of V.34 modem audio samples. More... | |
void | v34_tx_power (v34_state_t *s, float power) |
Adjust a V.34 modem transmit context's output power. More... | |
void | v34_set_get_bit (v34_state_t *s, span_get_bit_func_t get_bit, void *user_data) |
Change the get_bit function associated with a V.34 modem context. More... | |
void | v34_set_get_aux_bit (v34_state_t *s, span_get_bit_func_t get_bit, void *user_data) |
Change the get_aux_bit function associated with a V.34 modem context. More... | |
logging_state_t * | v34_get_logging_state (v34_state_t *s) |
Get the logging context associated with a V.34 modem context. More... | |
void | v34_set_working_parameters (v34_parameters_t *s, int baud_rate, int bit_rate, int expanded) |
int | v34_get_current_bit_rate (v34_state_t *s) |
Report the current operating bit rate of a V.34 modem context. More... | |
int | v34_half_duplex_change_mode (v34_state_t *s, int mode) |
Change the operating mode of a V.34 half-duplex modem. More... | |
int | v34_restart (v34_state_t *s, int baud_rate, int bit_rate, bool duplex) |
Reinitialise an existing V.34 modem context. More... | |
v34_state_t * | v34_init (v34_state_t *s, int baud_rate, int bit_rate, bool calling_party, bool duplex, span_get_bit_func_t get_bit, void *get_bit_user_data, span_put_bit_func_t put_bit, void *put_bit_user_data) |
Initialise a V.34 modem context. More... | |
int | v34_release (v34_state_t *s) |
Release a V.34 modem receive context. More... | |
int | v34_free (v34_state_t *s) |
Free a V.34 modem receive context. More... | |
int v34_free | ( | v34_state_t * | s | ) |
Free a V.34 modem receive context.
Free a V.34 modem receive context.
s | The modem context. |
int v34_get_current_bit_rate | ( | v34_state_t * | s | ) |
Report the current operating bit rate of a V.34 modem context.
Report the current operating bit rate of a V.34 modem context.
s | The modem context. |
References v34_state_s::bit_rate.
logging_state_t* v34_get_logging_state | ( | v34_state_t * | s | ) |
Get the logging context associated with a V.34 modem context.
Get the logging context associated with a V.34 modem context.
s | The modem context. |
References v34_state_s::logging.
int v34_half_duplex_change_mode | ( | v34_state_t * | s, |
int | mode | ||
) |
Change the operating mode of a V.34 half-duplex modem.
Change the operating mode of a V.34 half-duplex modem.
s | The modem context. |
mode | The new mode to be selected. |
v34_state_t* v34_init | ( | v34_state_t * | s, |
int | baud_rate, | ||
int | bit_rate, | ||
bool | calling_party, | ||
bool | duplex, | ||
span_get_bit_func_t | get_bit, | ||
void * | get_bit_user_data, | ||
span_put_bit_func_t | put_bit, | ||
void * | put_bit_user_data | ||
) |
Initialise a V.34 modem context.
Initialise a V.34 modem context. This must be called before the first use of the context, to initialise its contents.
s | The modem context. |
baud_rate | The baud rate of the modem. Valid values are 2400, 2743, 2800, 3000, 3200 and 3429 |
bit_rate | The bit rate of the modem. Valid values are 4800, 7200, 9600, 12000 and 14400. |
calling_party | True if this is the calling modem. |
duplex | True if this is a full duplex mode modem. Otherwise this is a half-duplex modem. |
get_bit | The callback routine used to get the data to be transmitted. |
get_bit_user_data | An opaque pointer, passed in calls to the gett routine. |
put_bit | The callback routine used to get the data to be transmitted. |
put_bit_user_data | An opaque pointer, passed in calls to the put routine. |
int v34_release | ( | v34_state_t * | s | ) |
Release a V.34 modem receive context.
Release a V.34 modem receive context.
s | The modem context. |
int v34_restart | ( | v34_state_t * | s, |
int | baud_rate, | ||
int | bit_rate, | ||
bool | duplex | ||
) |
Reinitialise an existing V.34 modem context.
Reinitialise an existing V.34 modem context, so it may be reused.
s | The modem context. |
baud_rate | The baud rate of the modem. Valid values are 2400, 2743, 2800, 3000, 3200 and 3429 |
bit_rate | The bit rate of the modem. Valid values are 4800, 7200, 9600, 12000 and 14400. |
duplex | True if this is a full duplex mode modem. Otherwise this is a half-duplex modem. |
void v34_set_get_aux_bit | ( | v34_state_t * | s, |
span_get_bit_func_t | get_bit, | ||
void * | user_data | ||
) |
Change the get_aux_bit function associated with a V.34 modem context.
Change the get_aux_bit function associated with a V.34 modem context.
s | The modem context. |
get_bit | The callback routine used to get the aux. data to be transmitted. |
user_data | An opaque pointer. |
void v34_set_get_bit | ( | v34_state_t * | s, |
span_get_bit_func_t | get_bit, | ||
void * | user_data | ||
) |
Change the get_bit function associated with a V.34 modem context.
Change the get_bit function associated with a V.34 modem context.
s | The modem context. |
get_bit | The callback routine used to get the data to be transmitted. |
user_data | An opaque pointer. |
int v34_tx | ( | v34_state_t * | s, |
int16_t | amp[], | ||
int | len | ||
) |
Generate a block of V.34 modem audio samples.
Generate a block of V.34 modem audio samples.
s | The modem context. |
amp | The audio sample buffer. |
len | The number of samples to be generated. |
void v34_tx_power | ( | v34_state_t * | s, |
float | power | ||
) |
Adjust a V.34 modem transmit context's output power.
Adjust a V.34 modem transmit context's power output.
s | The modem context. |
power | The power level, in dBm0 |