#include <inttypes.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/logging.h"
#include "spandsp/vector_float.h"
#include "spandsp/async.h"
#include "spandsp/power_meter.h"
#include "spandsp/arctan2.h"
#include "spandsp/complex.h"
#include "spandsp/dds.h"
#include "spandsp/complex_filters.h"
#include "spandsp/v29rx.h"
#include "spandsp/v22bis.h"
#include "v22bis_rx_1200_floating_rrc.h"
#include "v22bis_rx_2400_floating_rrc.h"
Defines | |
#define | ms_to_symbols(t) (((t)*600)/1000) |
#define | EQUALIZER_DELTA 0.25f |
#define | PULSESHAPER_COEFF_SETS 12 |
Enumerations | |
enum | { V22BIS_TRAINING_STAGE_NORMAL_OPERATION, V22BIS_TRAINING_STAGE_SYMBOL_ACQUISITION, V22BIS_TRAINING_STAGE_LOG_PHASE, V22BIS_TRAINING_STAGE_UNSCRAMBLED_ONES, V22BIS_TRAINING_STAGE_UNSCRAMBLED_0011, V22BIS_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200, V22BIS_TRAINING_STAGE_SCRAMBLED_ONES_AT_2400, V22BIS_TRAINING_STAGE_WAIT_FOR_START_1, V22BIS_TRAINING_STAGE_WAIT_FOR_START_2, V22BIS_TRAINING_STAGE_PARKED } |
Functions | |
float | v22bis_rx_carrier_frequency (v22bis_state_t *s) |
float | v22bis_symbol_timing_correction (v22bis_state_t *s) |
float | v22bis_rx_signal_power (v22bis_state_t *s) |
int | v22bis_equalizer_state (v22bis_state_t *s, complexf_t **coeffs) |
Get a snapshot of the current equalizer coefficients. | |
int | v22bis_rx (v22bis_state_t *s, const int16_t amp[], int len) |
Process a block of received V.22bis modem audio samples. | |
int | v22bis_rx_restart (v22bis_state_t *s, int bit_rate) |
Reinitialise an existing V.22bis modem receive context. | |
void | v22bis_set_qam_report_handler (v22bis_state_t *s, qam_report_handler_t handler, void *user_data) |
int v22bis_equalizer_state | ( | v22bis_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. |
References v22bis_state_t::eq_coeff, and v22bis_state_t::rx.
int v22bis_rx | ( | v22bis_state_t * | s, | |
const int16_t | amp[], | |||
int | len | |||
) |
Process a block of received V.22bis modem audio samples.
Process a block of received V.22bis modem audio samples.
s | The modem context. | |
amp | The audio sample buffer. | |
len | The number of samples in the buffer. |
References v22bis_state_t::agc_scaling, v22bis_state_t::bit_rate, v22bis_state_t::caller, v22bis_state_t::carrier_phase, v22bis_state_t::carrier_phase_rate, dds_complexf(), v22bis_state_t::eq_put_step, complexf_t::im, power_meter_update(), v22bis_state_t::put_bit, complexf_t::re, v22bis_state_t::rrc_filter, v22bis_state_t::rrc_filter_step, v22bis_state_t::rx, v22bis_state_t::rx_power, SIG_STATUS_CARRIER_DOWN, SIG_STATUS_CARRIER_UP, v22bis_state_t::signal_present, v22bis_state_t::training, v22bis_state_t::user_data, and v22bis_rx_restart().
float v22bis_rx_carrier_frequency | ( | v22bis_state_t * | s | ) |
Get the current received carrier frequency.
s | The modem context. |
References v22bis_state_t::carrier_phase_rate, dds_frequencyf(), and v22bis_state_t::rx.
int v22bis_rx_restart | ( | v22bis_state_t * | s, | |
int | bit_rate | |||
) |
Reinitialise an existing V.22bis modem receive context.
Reinitialise an existing V.22bis modem receive context.
s | The modem context. | |
bit_rate | The bit rate of the modem. Valid values are 1200 and 2400. |
References v22bis_state_t::agc_scaling, v22bis_state_t::baud_phase, v22bis_state_t::bit_rate, v22bis_state_t::caller, v22bis_state_t::carrier_off_power, v22bis_state_t::carrier_on_power, v22bis_state_t::carrier_phase, v22bis_state_t::carrier_phase_rate, v22bis_state_t::carrier_track_i, v22bis_state_t::carrier_track_p, v22bis_state_t::constellation_state, dds_phase_ratef(), v22bis_state_t::detected_unscrambled_ones, v22bis_state_t::detected_unscrambled_zeros, v22bis_state_t::gardner_integrate, v22bis_state_t::gardner_step, power_meter_init(), power_meter_level_dbm0(), v22bis_state_t::rrc_filter, v22bis_state_t::rrc_filter_step, v22bis_state_t::rx, v22bis_state_t::rx_power, v22bis_state_t::scramble_reg, v22bis_state_t::scrambler_pattern_count, v22bis_state_t::signal_present, v22bis_state_t::sixteen_way_decisions, v22bis_state_t::training, and v22bis_state_t::training_count.
Referenced by v22bis_restart(), and v22bis_rx().
float v22bis_rx_signal_power | ( | v22bis_state_t * | s | ) |
Get a current received signal power.
s | The modem context. |
References power_meter_current_dbm0(), v22bis_state_t::rx, and v22bis_state_t::rx_power.
void v22bis_set_qam_report_handler | ( | v22bis_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 v22bis_state_t::qam_report, v22bis_state_t::qam_user_data, and v22bis_state_t::rx.
float v22bis_symbol_timing_correction | ( | v22bis_state_t * | s | ) |
Get the current symbol timing correction since startup.
s | The modem context. |
References v22bis_state_t::rx, and v22bis_state_t::total_baud_timing_correction.