26 #if !defined(_SPANDSP_PRIVATE_V34_H_) 27 #define _SPANDSP_PRIVATE_V34_H_ 30 #define V34_INFO_TX_FILTER_STEPS 9 31 #define V34_TX_FILTER_STEPS 9 33 #define V34_RX_FILTER_STEPS 27 34 #define V34_RX_PULSESHAPER_COEFF_SETS 192 35 #define V34_RX_CC_PULSESHAPER_COEFF_SETS 12 37 #define V34_EQUALIZER_PRE_LEN 63 38 #define V34_EQUALIZER_POST_LEN 63 39 #define V34_EQUALIZER_MASK 127 45 #define V34_RX_PULSESHAPER_GAIN 1.000000f 49 #if defined(SPANDSP_USE_FIXED_POINT) 50 typedef int16_t v34_rx_shaper_t[V34_RX_PULSESHAPER_COEFF_SETS][V34_RX_FILTER_STEPS];
51 typedef int16_t cc_rx_shaper_t[V34_RX_CC_PULSESHAPER_COEFF_SETS][V34_RX_FILTER_STEPS];
53 typedef float v34_rx_shaper_t[V34_RX_PULSESHAPER_COEFF_SETS][V34_RX_FILTER_STEPS];
54 typedef float cc_rx_shaper_t[V34_RX_CC_PULSESHAPER_COEFF_SETS][V34_RX_FILTER_STEPS];
57 typedef const uint8_t conv_encode_table_t[64][16];
58 typedef const uint8_t conv_decode_table_t[16][16];
62 V34_MODULATION_V34 = 0,
66 V34_MODULATION_SILENCE
71 V34_RX_STAGE_INFO0 = 1,
79 V34_RX_STAGE_PRIMARY_CHANNEL
86 V34_TX_STAGE_INITIAL_PREAMBLE = 1,
90 V34_TX_STAGE_INITIAL_A,
93 V34_TX_STAGE_FIRST_NOT_A,
94 V34_TX_STAGE_FIRST_NOT_A_REVERSAL_SEEN,
95 V34_TX_STAGE_SECOND_A,
100 V34_TX_STAGE_POST_L2_A,
101 V34_TX_STAGE_POST_L2_NOT_A,
102 V34_TX_STAGE_A_SILENCE,
103 V34_TX_STAGE_PRE_INFO1_A,
107 V34_TX_STAGE_FIRST_B,
108 V34_TX_STAGE_FIRST_B_INFO_SEEN,
109 V34_TX_STAGE_FIRST_NOT_B_WAIT,
110 V34_TX_STAGE_FIRST_NOT_B,
111 V34_TX_STAGE_FIRST_B_SILENCE,
112 V34_TX_STAGE_FIRST_B_POST_REVERSAL_SILENCE,
113 V34_TX_STAGE_SECOND_B,
114 V34_TX_STAGE_SECOND_B_WAIT,
115 V34_TX_STAGE_SECOND_NOT_B,
117 V34_TX_STAGE_INFO0_RETRY,
119 V34_TX_STAGE_FIRST_S,
120 V34_TX_STAGE_FIRST_NOT_S,
123 V34_TX_STAGE_SECOND_S,
124 V34_TX_STAGE_SECOND_NOT_S,
130 V34_TX_STAGE_J_DASHED,
135 V34_TX_STAGE_HDX_INITIAL_A,
136 V34_TX_STAGE_HDX_FIRST_A,
137 V34_TX_STAGE_HDX_FIRST_NOT_A,
138 V34_TX_STAGE_HDX_FIRST_A_SILENCE,
139 V34_TX_STAGE_HDX_SECOND_A,
140 V34_TX_STAGE_HDX_SECOND_A_WAIT,
142 V34_TX_STAGE_HDX_FIRST_B,
143 V34_TX_STAGE_HDX_FIRST_B_INFO_SEEN,
144 V34_TX_STAGE_HDX_FIRST_NOT_B_WAIT,
145 V34_TX_STAGE_HDX_FIRST_NOT_B,
146 V34_TX_STAGE_HDX_POST_L2_B,
147 V34_TX_STAGE_HDX_POST_L2_SILENCE,
153 V34_TX_STAGE_HDX_FIRST_ALT,
155 V34_TX_STAGE_HDX_PPH,
157 V34_TX_STAGE_HDX_SECOND_ALT,
159 V34_TX_STAGE_HDX_MPH,
168 V34_EVENT_REVERSAL_1,
169 V34_EVENT_REVERSAL_2,
170 V34_EVENT_REVERSAL_3,
183 bool support_baud_rate_low_carrier[6];
184 bool support_baud_rate_high_carrier[6];
185 bool support_power_reduction;
186 uint8_t max_baud_rate_difference;
187 bool support_1664_point_constellation;
188 uint8_t tx_clock_source;
190 bool rate_3429_allowed;
195 bool use_high_carrier;
203 int additional_power_reduction;
212 int additional_power_reduction;
215 bool use_high_carrier;
216 int preemphasis_filter;
218 int baud_rate_a_to_c;
219 int baud_rate_c_to_a;
226 bool use_high_carrier;
227 int preemphasis_filter;
237 int aux_channel_supported;
239 bool use_non_linear_encoder;
240 bool expanded_shaping;
241 bool mp_acknowledged;
242 int signalling_rate_mask;
243 bool asymmetric_rates_allowed;
252 int control_channel_2400;
254 bool use_non_linear_encoder;
255 bool expanded_shaping;
256 int signalling_rate_mask;
257 bool asymmetric_rates_allowed;
321 bool use_non_linear_encoder;
323 #if defined(SPANDSP_USE_FIXED_POINT) 360 #if defined(SPANDSP_USE_FIXED_POINT) 366 #if defined(SPANDSP_USE_FIXED_POINT) 368 int16_t rrc_filter_re[V34_INFO_TX_FILTER_STEPS];
369 int16_t rrc_filter_im[V34_INFO_TX_FILTER_STEPS];
373 float rrc_filter_re[V34_INFO_TX_FILTER_STEPS];
374 float rrc_filter_im[V34_INFO_TX_FILTER_STEPS];
399 int current_modulator;
402 int line_probe_cycles;
404 float line_probe_scaling;
417 const conv_encode_table_t *conv_encode_table;
419 bool info0_acknowledgement;
447 #if defined(SPANDSP_USE_FIXED_POINT) 449 int32_t symbol_sync_low[2];
451 int32_t symbol_sync_high[2];
453 int32_t symbol_sync_dc_filter[2];
458 int32_t low_band_edge_coeff[3];
460 int32_t high_band_edge_coeff[3];
462 int32_t mixed_edges_coeff_3;
465 float symbol_sync_low[2];
467 float symbol_sync_high[2];
469 float symbol_sync_dc_filter[2];
474 float low_band_edge_coeff[3];
476 float high_band_edge_coeff[3];
491 uint32_t cumulative_path_metric[16];
493 uint16_t previous_path_ptr[16];
495 uint16_t branch_error_x[8];
505 int16_t curr_min_state;
511 uint16_t branch_error[8];
513 const conv_decode_table_t *conv_decode_table;
540 qam_report_handler_t qam_report;
611 #if defined(SPANDSP_USE_FIXED_POINT) 612 int16_t rrc_filter[V34_RX_FILTER_STEPS];
614 float rrc_filter[V34_RX_FILTER_STEPS];
624 #if defined(SPANDSP_USE_FIXED_POINT) 628 int16_t agc_scaling_save;
638 #if defined(SPANDSP_USE_FIXED_POINT) 640 float carrier_track_p;
642 float carrier_track_i;
650 const v34_rx_shaper_t *shaper_re;
651 const v34_rx_shaper_t *shaper_im;
666 uint32_t last_angles[2];
669 uint8_t info_buf[25];
691 bool info0_acknowledgement;
711 #if defined(SPANDSP_USE_FIXED_POINT) 712 int16_t dft_buffer[160];
713 int32_t l1_l2_gains[25];
714 int32_t l1_l2_phases[25];
719 float l1_l2_gains[25];
720 float l1_l2_phases[25];
726 int current_demodulator;
732 span_sample_timer_t tone_ab_hop_time;
bool half_duplex_state
Definition: private/v34.h:525
int16_t high_sample
A highest magnitude sample seen.
Definition: private/v34.h:689
Definition: private/v34.h:289
float agc_scaling
The scaling factor assessed by the AGC algorithm.
Definition: private/v34.h:631
float guard_level
Guard tone signal level.
Definition: private/v34.h:392
int32_t cc_carrier_phase_rate
The update rate for the phase of the control channel carrier (i.e. the DDS increment).
Definition: private/v34.h:383
Definition: private/v34.h:248
Definition: private/power_meter.h:33
int samples_per_symbol_numerator
Definition: private/v34.h:284
Definition: private/v34.h:209
int samples_per_symbol_denominator
Definition: private/v34.h:286
int32_t guard_phase_rate
The update rate for the phase of the guard tone (i.e. the DDS increment).
Definition: private/v34.h:390
void * get_bit_user_data
A user specified opaque pointer passed to the get_bit function.
Definition: private/v34.h:304
int bit_rate
Parameters for the current bit rate and baud rate.
Definition: private/v34.h:268
logging_state_t logging
Error and flow logging control.
Definition: private/v34.h:759
int rrc_filter_step
Current offset into the RRC pulse shaping filter buffer.
Definition: private/v34.h:378
power_meter_t power
A power meter, to measure the HPF'ed signal power in the channel.
Definition: private/v34.h:561
int r
Mapping frame switching parameter.
Definition: private/v34.h:281
uint32_t r0
Mapping frame output.
Definition: private/v34.h:572
void * get_aux_bit_user_data
A user specified opaque pointer passed to the get_aux_bit function.
Definition: private/v34.h:309
void * put_bit_user_data
A user specified opaque pointer passed to the put_bit routine.
Definition: private/v34.h:531
int windup
Countdown to the first data being available from the viterbi pipeline.
Definition: private/v34.h:504
Definition: private/v34.h:200
int(* span_get_bit_func_t)(void *user_data)
Definition: async.h:127
span_sample_timer_t sample_time
Used to align the transmit and receive positions, to ensure things like round trip delay are properly...
Definition: private/v34.h:730
bool duplex
True if this is a full duplex modem.
Definition: private/v34.h:521
bool high_carrier
True if using the higher of the two carrier frequency options.
Definition: private/v34.h:314
v34_parameters_t parms
Parameters for the current bit rate and baud rate.
Definition: private/v34.h:345
int k
The number of shell mapped bits.
Definition: private/v34.h:273
bool high_carrier
True if using the higher of the two carrier frequency options.
Definition: private/v34.h:548
void * qam_user_data
A user specified opaque pointer passed to the qam_report callback routine.
Definition: private/v34.h:543
int scrambler_tap
The scrambler tap which selects between the caller and answerer scramblers.
Definition: private/v34.h:556
int q
The number of uncoded Q bits per 2D symbol.
Definition: private/v34.h:278
bool calling_party
True if this is the calling side modem.
Definition: private/v34.h:519
bool duplex
True if this is a full duplex modem.
Definition: private/v34.h:746
Definition: private/v34.h:193
int total_baud_timing_correction
The total symbol timing correction since the carrier came up. This is only for performance analysis p...
Definition: private/v34.h:655
int32_t carrier_on_power
The power meter level at which carrier on is declared.
Definition: private/v34.h:563
int32_t v34_carrier_phase_rate
The update rate for the phase of the V.34 carrier (i.e. the DDS increment).
Definition: private/v34.h:608
void(* span_put_bit_func_t)(void *user_data, int bit)
Definition: async.h:123
bool half_duplex_source
Definition: private/v34.h:523
int rrc_filter_step
Current offset into the RRC pulse shaping filter buffer.
Definition: private/v34.h:617
Definition: private/v34.h:445
int scrambler_tap
The scrambler tap which selects between the caller and answerer scramblers.
Definition: private/v34.h:319
Definition: private/bitstream.h:30
span_get_bit_func_t get_bit
The callback function used to get the next bit to be transmitted.
Definition: private/v34.h:302
int32_t v34_carrier_phase_rate
The update rate for the phase of the V.34 carrier (i.e. the DDS increment).
Definition: private/v34.h:385
int eq_step
Current read offset into the equalizer buffer.
Definition: private/v34.h:619
int b
Bits per high mapping frame. A low mapping frame is one bit less.
Definition: private/v34.h:270
Definition: private/v34.h:741
float carrier_track_i
The integral part of the carrier tracking filter.
Definition: private/v34.h:647
int low_samples
A count of the current consecutive samples below the carrier off threshold.
Definition: private/v34.h:687
int carrier_drop_pending
Whether or not a carrier drop was detected and the signal delivery is pending.
Definition: private/v34.h:685
span_put_bit_func_t put_bit
The callback function used to put each bit received.
Definition: private/v34.h:529
int baud_rate
The current baud rate selection, as a value from 0 to 5.
Definition: private/v34.h:312
float baud_phase
Baud phase for symbol sync.
Definition: private/v34.h:471
float carrier_track_p
The proportional part of the carrier tracking filter.
Definition: private/v34.h:645
bool calling_party
True if this is the calling side modem.
Definition: private/v34.h:292
span_get_bit_func_t current_get_bit
The get_bit function in use at any instant.
Definition: private/v34.h:436
bool half_duplex_state
Definition: private/v34.h:298
int baud_rate
The current baud rate selection, as a value from 0 to 5.
Definition: private/v34.h:546
uint32_t scramble_reg
The register for the data scrambler.
Definition: private/v34.h:554
bool half_duplex_state
Definition: private/v34.h:750
uint32_t guard_phase
The current phase of the guard tone (i.e. the DDS parameter).
Definition: private/v34.h:388
bool half_duplex_source
Definition: private/v34.h:296
int baud_half
The current half of the baud.
Definition: private/v34.h:658
Definition: private/v34.h:263
Definition: private/v34.h:222
v34_parameters_t parms
Parameters for the current bit rate and baud rate.
Definition: private/v34.h:582
int baud_phase
The current fractional phase of the baud timing.
Definition: private/v34.h:394
span_put_bit_func_t put_aux_bit
The callback function used to put each aux bit received.
Definition: private/v34.h:534
span_sample_timer_t sample_time
Used to align the transmit and receive positions, to ensure things like round trip delay are properly...
Definition: private/v34.h:440
uint32_t r0
Mapping frame parsed input.
Definition: private/v34.h:330
Definition: private/logging.h:33
int bit_rate
The bit rate of the modem.
Definition: private/v34.h:752
uint32_t carrier_phase
The current phase of the carrier (i.e. the DDS parameter).
Definition: private/v34.h:601
int32_t carrier_off_power
The power meter level at which carrier off is declared.
Definition: private/v34.h:565
bool calling_party
True if this is the calling side modem.
Definition: private/v34.h:744
span_get_bit_func_t get_aux_bit
The callback function used to get the next aux channel bit to be transmitted.
Definition: private/v34.h:307
int32_t carrier_phase_rate_save
The carrier update rate saved for reuse when using short training.
Definition: private/v34.h:603
int32_t cc_carrier_phase_rate
The update rate for the phase of the control channel carrier (i.e. the DDS increment).
Definition: private/v34.h:606
bool half_duplex_source
Definition: private/v34.h:748
float mixed_edges_coeff_3
A coefficient common to the low and high band edges.
Definition: private/v34.h:478
int max_bit_rate_code
The code (0-16) for the maximum bit rate.
Definition: private/v34.h:266
Definition: private/modem_echo.h:62
int eq_put_step
Current write offset into the equalizer buffer.
Definition: private/v34.h:621
int round_trip_delay_estimate
The measured round trip delay estimate, in sample times.
Definition: private/v34.h:660
int ptr
Latest viterbi table slot.
Definition: private/v34.h:502
complexi16_t yt
yt's are the noise corrupted points fed to the viterbi decoder. Assumed to have format 9:7 (7 fractio...
Definition: private/v34.h:586
bool duplex
True if this is a full duplex modem.
Definition: private/v34.h:294
uint32_t carrier_phase
The current phase of the carrier (i.e. the DDS parameter).
Definition: private/v34.h:381
Definition: private/v34.h:232
void * put_aux_bit_user_data
A user specified opaque pointer passed to the put_aux_bit routine.
Definition: private/v34.h:536
Definition: private/v34.h:482
Definition: private/v34.h:516
float agc_scaling_save
The previous value of agc_scaling, needed to reuse old training.
Definition: private/v34.h:633
Definition: private/v34.h:181
uint32_t scramble_reg
The register for the data scrambler.
Definition: private/v34.h:317