spandsp 3.0.0
|
Go to the source code of this file.
Macros | |
#define | V34_CONSTELLATION_SCALING_FACTOR 1.0 |
Typedefs | |
typedef struct v34_state_s | v34_state_t |
Functions | |
int | v34_rx (v34_state_t *s, const int16_t amp[], int len) |
Process a block of received V.34 modem audio samples. | |
int | v34_rx_fillin (v34_state_t *s, int len) |
Fake processing of a missing block of received V.34 modem audio samples. | |
int | v34_equalizer_state (v34_state_t *s, complexf_t **coeffs) |
Get a snapshot of the current equalizer coefficients. | |
float | v34_rx_carrier_frequency (v34_state_t *s) |
float | v34_rx_symbol_timing_correction (v34_state_t *s) |
float | v34_rx_signal_power (v34_state_t *s) |
void | v34_rx_set_signal_cutoff (v34_state_t *s, float cutoff) |
void | v34_set_qam_report_handler (v34_state_t *s, qam_report_handler_t handler, void *user_data) |
int | v34_tx (v34_state_t *s, int16_t amp[], int 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. | |
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. | |
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_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. | |
void | v34_set_put_bit (v34_state_t *s, span_put_bit_func_t put_bit, void *user_data) |
Change the put_bit function associated with a V.34 modem context. | |
void | v34_set_put_aux_bit (v34_state_t *s, span_put_bit_func_t put_bit, void *user_data) |
Change the put_aux_bit function associated with a V.34 modem context. |
typedef struct v34_state_s v34_state_t |
V.34 modem descriptor. This defines the working state for a single instance of a V.34 modem.
int v34_equalizer_state | ( | v34_state_t * | s, |
complexf_t ** | coeffs ) |
Get a snapshot of the current equalizer coefficients.
Get a snapshot of the current equalizer coefficients.
coeffs | The vector of complex coefficients. |
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().
int v34_rx | ( | v34_state_t * | s, |
const int16_t | amp[], | ||
int | len ) |
Process a block of received V.34 modem audio samples.
Process a block of received V.34 modem audio samples.
s | The modem context. |
amp | The audio sample buffer. |
len | The number of samples in the buffer. |
References v34_rx_state_t::sample_time.
float v34_rx_carrier_frequency | ( | v34_state_t * | s | ) |
Get the current received carrier frequency.
s | The modem context. |
References dds_frequency(), and v34_rx_state_t::v34_carrier_phase_rate.
int v34_rx_fillin | ( | v34_state_t * | s, |
int | len ) |
Fake processing of a missing block of received V.34 modem audio samples.
Fake processing of a missing block of received V.34 modem audio samples. (e.g due to packet loss).
s | The modem context. |
len | The number of samples to fake. |
References v34_rx_state_t::carrier_phase, dds_advance(), dds_advancef(), v34_state_s::logging, span_log(), and v34_rx_state_t::v34_carrier_phase_rate.
void v34_rx_set_signal_cutoff | ( | v34_state_t * | s, |
float | cutoff ) |
Set the power level at which the carrier detection will cut in
s | The modem context. |
cutoff | The signal cutoff power, in dBm0. |
References v34_rx_state_t::carrier_off_power, v34_rx_state_t::carrier_on_power, and power_meter_level_dbm0().
Referenced by v34_init().
float v34_rx_signal_power | ( | v34_state_t * | s | ) |
Get a current received signal power.
s | The modem context. |
float v34_rx_symbol_timing_correction | ( | v34_state_t * | s | ) |
Get the current symbol timing correction since startup.
s | The 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.
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.
void v34_set_put_aux_bit | ( | v34_state_t * | s, |
span_put_bit_func_t | put_bit, | ||
void * | user_data ) |
Change the put_aux_bit function associated with a V.34 modem context.
Change the put_aux_bit function associated with a V.34 modem context.
s | The modem context. |
put_bit | The callback routine used to process the aux data received. |
user_data | An opaque pointer. |
References v34_rx_state_t::put_aux_bit, and v34_rx_state_t::put_aux_bit_user_data.
void v34_set_put_bit | ( | v34_state_t * | s, |
span_put_bit_func_t | put_bit, | ||
void * | user_data ) |
Change the put_bit function associated with a V.34 modem context.
Change the put_bit function associated with a V.34 modem context.
s | The modem context. |
put_bit | The callback routine used to process the data received. |
user_data | An opaque pointer. |
References v34_rx_state_t::put_bit, and v34_rx_state_t::put_bit_user_data.
void v34_set_qam_report_handler | ( | v34_state_t * | s, |
qam_report_handler_t | handler, | ||
void * | user_data ) |
Set a handler routine to process QAM status reports
s | The modem context. |
handler | The handler routine. |
user_data | An opaque pointer passed to the handler routine. |
References v34_rx_state_t::qam_report, and v34_rx_state_t::qam_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().