spandsp  3.0.0
v34rx.c File Reference
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include <stdio.h>
#include <stddef.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/modem_echo.h"
#include "spandsp/private/power_meter.h"
#include "spandsp/private/v34.h"
#include "v22bis_rx_1200_rrc.h"
#include "v22bis_rx_2400_rrc.h"
#include "v34_rx_2400_low_carrier_rrc.h"
#include "v34_rx_2400_high_carrier_rrc.h"
#include "v34_rx_2743_low_carrier_rrc.h"
#include "v34_rx_2743_high_carrier_rrc.h"
#include "v34_rx_2800_low_carrier_rrc.h"
#include "v34_rx_2800_high_carrier_rrc.h"
#include "v34_rx_3000_low_carrier_rrc.h"
#include "v34_rx_3000_high_carrier_rrc.h"
#include "v34_rx_3200_low_carrier_rrc.h"
#include "v34_rx_3200_high_carrier_rrc.h"
#include "v34_rx_3429_rrc.h"
#include "v34_local.h"
#include "v34_tables.h"
#include "v34_superconstellation_map.h"
#include "v34_convolutional_coders.h"
#include "v34_shell_map.h"
#include "v34_probe_signals.h"

Macros

#define M_PI   3.14159265358979323846264338327
 
#define FP_Q9_7_TO_F(x)   ((float) x/128.0f)
 
#define CARRIER_NOMINAL_FREQ   1800.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 complex_sig_set(re, im)   complex_setf(re,im)
 
#define complex_sig_t   complexf_t
 
#define TRAINING_SCALE(x)   (x)
 
#define BYPASS_VITERBI
 

Enumerations

enum  { TRAINING_TX_STAGE_NORMAL_OPERATION_V34 = 0, TRAINING_TX_STAGE_NORMAL_OPERATION_CC = 1, TRAINING_TX_STAGE_PARKED }
 

Functions

float v34_rx_carrier_frequency (v34_state_t *s)
 
void v34_put_mapping_frame (v34_rx_state_t *s, int16_t bits[16])
 
int v34_rx_fillin (v34_state_t *s, int len)
 Fake processing of a missing block of received V.34 modem audio samples. More...
 
int v34_rx (v34_state_t *s, const int16_t amp[], int len)
 Process a block of received V.34 modem audio samples. More...
 
void v34_rx_set_signal_cutoff (v34_state_t *s, float cutoff)
 
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. More...
 
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. More...
 
int v34_rx_restart (v34_state_t *s, int baud_rate, int bit_rate, int high_carrier)
 
void v34_set_qam_report_handler (v34_state_t *s, qam_report_handler_t handler, void *user_data)
 

Function Documentation

◆ v34_rx()

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.

Parameters
sThe modem context.
ampThe audio sample buffer.
lenThe number of samples in the buffer.
Returns
The number of samples unprocessed.

◆ v34_rx_carrier_frequency()

float v34_rx_carrier_frequency ( v34_state_t s)

Get the current received carrier frequency.

Parameters
sThe modem context.
Returns
The frequency, in Hertz.

References dds_frequency(), and v34_rx_state_t::v34_carrier_phase_rate.

◆ v34_rx_fillin()

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).

Parameters
sThe modem context.
lenThe number of samples to fake.
Returns
The number of samples unprocessed.

References v34_state_s::logging, and span_log().

◆ v34_rx_set_signal_cutoff()

void v34_rx_set_signal_cutoff ( v34_state_t s,
float  cutoff 
)

Set the power level at which the carrier detection will cut in

Parameters
sThe modem context.
cutoffThe 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().

◆ v34_set_put_aux_bit()

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.

Parameters
sThe modem context.
put_bitThe callback routine used to process the aux data received.
user_dataAn opaque pointer.

◆ v34_set_put_bit()

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.

Parameters
sThe modem context.
put_bitThe callback routine used to process the data received.
user_dataAn opaque pointer.

◆ v34_set_qam_report_handler()

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

Parameters
sThe modem context.
handlerThe handler routine.
user_dataAn opaque pointer passed to the handler routine.