26 #if !defined(_SPANDSP_PRIVATE_V27TER_TX_H_)
27 #define _SPANDSP_PRIVATE_V27TER_TX_H_
30 #define V27TER_TX_FILTER_STEPS 9
50 #if defined(SPANDSP_USE_FIXED_POINT)
v27ter_tx_state_t * v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
Initialise a V.27ter modem transmit context.
Definition: v27ter_tx.c:413
logging_state_t * v27ter_tx_get_logging_state(v27ter_tx_state_t *s)
Get the logging context associated with a V.27ter modem transmit context.
Definition: v27ter_tx.c:384
Definition: line_model.h:67
int v27ter_tx_free(v27ter_tx_state_t *s)
Free a V.27ter modem transmit context.
Definition: v27ter_tx.c:446
void v27ter_rx_set_modem_status_handler(v27ter_rx_state_t *s, modem_status_func_t handler, void *user_data)
Change the modem status report function associated with a V.27ter modem receive context.
Definition: v27ter_rx.c:1023
void(* modem_status_func_t)(void *user_data, int status)
Definition: async.h:114
int v27ter_tx_release(v27ter_tx_state_t *s)
Release a V.27ter modem transmit context.
Definition: v27ter_tx.c:440
void v27ter_tx_set_modem_status_handler(v27ter_tx_state_t *s, modem_status_func_t handler, void *user_data)
Change the modem status report function associated with a V.27ter modem transmit context.
Definition: v27ter_tx.c:377
logging_state_t * v27ter_rx_get_logging_state(v27ter_rx_state_t *s)
Get the logging context associated with a V.27ter modem receive context.
Definition: v27ter_rx.c:1030
v27ter_tx_state_t * v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
Initialise a V.27ter modem transmit context.
Definition: v27ter_tx.c:413
float v27ter_rx_symbol_timing_correction(v27ter_rx_state_t *s)
Definition: v27ter_rx.c:143
int32_t dds_phase_ratef(float frequency)
Find the phase rate equivalent to a frequency, in Hz.
Definition: dds_float.c:2109
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition: private/v27ter_tx.h:48
#define V27TER_TRAINING_SEG_2
Definition: v27ter_tx.c:78
complexf_t dds_complexf(uint32_t *phase_acc, int32_t phase_rate)
Generate a complex floating point tone sample.
Definition: dds_float.c:2165
int32_t carrier_phase_rate
The update rate for the phase of the carrier (i.e. the DDS increment).
Definition: private/v27ter_tx.h:82
logging_state_t * v27ter_tx_get_logging_state(v27ter_tx_state_t *s)
Get the logging context associated with a V.27ter modem transmit context.
Definition: v27ter_tx.c:384
float v27ter_rx_carrier_frequency(v27ter_rx_state_t *s)
Definition: v27ter_rx.c:137
const char * signal_status_to_str(int status)
Convert a signal status to a short text description.
Definition: async.c:42
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data)
Get the next bit of a transmitted serial bit stream.
get_bit_func_t current_get_bit
The get_bit function in use at any instant.
Definition: private/v27ter_tx.h:88
Definition: private/bert.h:61
int v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train)
Reinitialise an existing V.27ter modem receive context.
Definition: v27ter_rx.c:1036
float im
Imaginary part.
Definition: complex.h:47
#define CARRIER_NOMINAL_FREQ
Definition: v27ter_tx.c:70
#define V27TER_TRAINING_SEG_3
Definition: v27ter_tx.c:80
int bit_rate
The bit rate of the modem. Valid values are 2400 and 4800.
Definition: private/v27ter_tx.h:39
int scrambler_pattern_count
A counter for the number of consecutive bits of repeating pattern through the scrambler.
Definition: private/v27ter_tx.h:72
@ SIG_STATUS_SHUTDOWN_COMPLETE
A modem has completed its task, and shut down.
Definition: async.h:77
int(* get_bit_func_t)(void *user_data)
Definition: async.h:108
uint32_t scramble_reg
The register for the training and data scrambler.
Definition: private/v27ter_tx.h:69
int v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
Reinitialise an existing V.27ter modem transmit context.
Definition: v27ter_tx.c:390
void v27ter_rx_set_qam_report_handler(v27ter_rx_state_t *s, qam_report_handler_t handler, void *user_data)
Definition: v27ter_rx.c:1144
Definition: private/v27ter_tx.h:37
get_bit_func_t get_bit
The callback function used to get the next bit to be transmitted.
Definition: private/v27ter_tx.h:41
modem_status_func_t status_handler
The callback function used to report modem status changes.
Definition: private/v27ter_tx.h:46
int baud_phase
The current fractional phase of the baud timing.
Definition: private/v27ter_tx.h:84
void v27ter_tx_power(v27ter_tx_state_t *s, float power)
Adjust a V.27ter modem transmit context's output power.
Definition: v27ter_tx.c:353
#define V27TER_TRAINING_SEG_5
Definition: v27ter_tx.c:84
Definition: private/v27ter_rx.h:52
float gain_2400
The gain factor needed to achieve the specified output power at 2400bps.
Definition: private/v27ter_tx.h:59
v27ter_rx_state_t * v27ter_rx_init(v27ter_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data)
Initialise a V.27ter modem receive context.
Definition: v27ter_rx.c:1104
void * get_bit_user_data
A user specified opaque pointer passed to the get_bit function.
Definition: private/v27ter_tx.h:43
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.
Definition: v27ter_tx.c:368
#define V27TER_TRAINING_END
Definition: v27ter_tx.c:86
#define V27TER_TRAINING_SEG_4
Definition: v27ter_tx.c:82
int v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
Reinitialise an existing V.27ter modem transmit context.
Definition: v27ter_tx.c:390
int v27ter_rx_equalizer_state(v27ter_rx_state_t *s, complexf_t **coeffs)
Get a snapshot of the current equalizer coefficients.
Definition: v27ter_rx.c:178
void v27ter_tx_set_modem_status_handler(v27ter_tx_state_t *s, modem_status_func_t handler, void *user_data)
Change the modem status report function associated with a V.27ter modem transmit context.
Definition: v27ter_tx.c:377
#define V27TER_TRAINING_SHUTDOWN_END
Definition: v27ter_tx.c:88
complexf_t rrc_filter[2 *9]
The root raised cosine (RRC) pulse shaping filter buffer.
Definition: private/v27ter_tx.h:63
float re
Real part.
Definition: complex.h:45
uint32_t carrier_phase
The current phase of the carrier (i.e. the DDS parameter).
Definition: private/v27ter_tx.h:80
void v27ter_tx_power(v27ter_tx_state_t *s, float power)
Adjust a V.27ter modem transmit context's output power.
Definition: v27ter_tx.c:353
int constellation_state
The code number for the current position in the constellation.
Definition: private/v27ter_tx.h:86
float gain_4800
The gain factor needed to achieve the specified output power at 4800bps.
Definition: private/v27ter_tx.h:61
int in_training
TRUE if transmitting the training sequence, or shutting down transmission. FALSE if transmitting user...
Definition: private/v27ter_tx.h:75
int training_step
A counter used to track progress through sending the training sequence.
Definition: private/v27ter_tx.h:77
@ SIG_STATUS_TRAINING_SUCCEEDED
The modem has trained, and is ready for data exchange.
Definition: async.h:65
float v27ter_rx_signal_power(v27ter_rx_state_t *s)
Definition: v27ter_rx.c:152
Definition: private/logging.h:34
qam_report_handler_t qam_report
A callback function which may be enabled to report every symbol's constellation position.
Definition: private/v27ter_rx.h:67
int rrc_filter_step
Current offset into the RRC pulse shaping filter buffer.
Definition: private/v27ter_tx.h:66
#define V27TER_TRAINING_SEG_1
Definition: v27ter_tx.c:76
@ SIG_STATUS_END_OF_DATA
The data stream has ended.
Definition: async.h:71
complexi_t dds_complexi(uint32_t *phase_acc, int32_t phase_rate)
Generate a complex integer tone sample.
Definition: dds_int.c:394
logging_state_t logging
Error and flow logging control.
Definition: private/v27ter_tx.h:90