|
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) |
| #define | complex_sig_t complexf_t |
| #define | FP_Q9_7_TO_F(x) |
| #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) |
| #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. | |
| void | v34_tx_power (v34_state_t *s, float power) |
| Adjust a V.34 modem transmit context's output power. | |
| 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. | |
| 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. | |
| logging_state_t * | v34_get_logging_state (v34_state_t *s) |
| Get the logging context associated with a V.34 modem context. | |
| 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. | |
| int | v34_half_duplex_change_mode (v34_state_t *s, int mode) |
| Change the operating mode of a V.34 half-duplex modem. | |
| int | v34_restart (v34_state_t *s, int baud_rate, int bit_rate, bool duplex) |
| Reinitialise an existing V.34 modem context. | |
| 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. | |
| int | v34_release (v34_state_t *s) |
| Release a V.34 modem receive context. | |
| int | v34_free (v34_state_t *s) |
| Free a V.34 modem receive context. | |
| #define complex_sig_set | ( | re, | |
| im ) |
| #define FP_Q9_7_TO_F | ( | x | ) |
| #define TRAINING_SCALE | ( | x | ) |
| 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. |
References v34_rx_state_t::half_duplex_source, v34_state_s::half_duplex_source, v34_tx_state_t::half_duplex_source, v34_rx_state_t::half_duplex_state, v34_state_s::half_duplex_state, and v34_tx_state_t::half_duplex_state.
| 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. |
References v34_rx_state_t::agc_scaling, v34_rx_state_t::agc_scaling_save, v34_state_s::bit_rate, v34_rx_state_t::calling_party, v34_state_s::calling_party, v34_tx_state_t::calling_party, v34_rx_state_t::carrier_phase_rate_save, v34_tx_state_t::get_bit, v34_tx_state_t::get_bit_user_data, v34_state_s::logging, v34_rx_state_t::put_bit, v34_rx_state_t::put_bit_user_data, v34_rx_state_t::scrambler_tap, v34_tx_state_t::scrambler_tap, v34_restart(), v34_rx_set_signal_cutoff(), and v34_tx_power().
| 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. |
References v34_state_s::calling_party, v34_rx_state_t::duplex, v34_state_s::duplex, v34_tx_state_t::duplex, v34_rx_state_t::half_duplex_source, v34_state_s::half_duplex_source, v34_tx_state_t::half_duplex_source, v34_state_s::logging, and span_log().
Referenced by v34_init().
| 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. |
References v34_tx_state_t::get_aux_bit, and v34_tx_state_t::get_aux_bit_user_data.
| 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. |
References v34_tx_state_t::current_get_bit, v34_tx_state_t::get_bit, and v34_tx_state_t::get_bit_user_data.
| 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. |
References v34_tx_state_t::sample_time.
| 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 |
Referenced by v34_init().