spandsp 3.0.0
private/v34.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/v34.h - ITU V.34 modem
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2009 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#if !defined(_SPANDSP_PRIVATE_V34_H_)
27#define _SPANDSP_PRIVATE_V34_H_
28
29/*! The number of taps in the info data transmit pulse shaping filter */
30#define V34_INFO_TX_FILTER_STEPS 9
31#define V34_TX_FILTER_STEPS 9
32
33#define V34_RX_FILTER_STEPS 27
34#define V34_RX_PULSESHAPER_COEFF_SETS 192
35#define V34_RX_CC_PULSESHAPER_COEFF_SETS 12
36
37#define V34_EQUALIZER_PRE_LEN 63
38#define V34_EQUALIZER_POST_LEN 63
39#define V34_EQUALIZER_MASK 127
40
41/*! The offset between x index values, and what they mean in terms of the V.34
42 spec numbering */
43#define V34_XOFF 3
44
45#define V34_RX_PULSESHAPER_GAIN 1.000000f
46
47extern const complexf_t v34_constellation[16];
48
49#if defined(SPANDSP_USE_FIXED_POINT)
50typedef int16_t v34_rx_shaper_t[V34_RX_PULSESHAPER_COEFF_SETS][V34_RX_FILTER_STEPS];
51typedef int16_t cc_rx_shaper_t[V34_RX_CC_PULSESHAPER_COEFF_SETS][V34_RX_FILTER_STEPS];
52#else
53typedef float v34_rx_shaper_t[V34_RX_PULSESHAPER_COEFF_SETS][V34_RX_FILTER_STEPS];
54typedef float cc_rx_shaper_t[V34_RX_CC_PULSESHAPER_COEFF_SETS][V34_RX_FILTER_STEPS];
55#endif
56
57typedef uint8_t conv_encode_table_t[64][16];
58typedef uint8_t conv_decode_table_t[16][16];
59
60enum
61{
62 V34_MODULATION_V34 = 0,
63 V34_MODULATION_CC,
64 V34_MODULATION_TONES,
65 V34_MODULATION_L1_L2,
66 V34_MODULATION_SILENCE
67};
68
69enum v34_rx_stages_e
70{
71 V34_RX_STAGE_INFO0 = 1,
72 V34_RX_STAGE_INFOH,
73 V34_RX_STAGE_INFO1C,
74 V34_RX_STAGE_INFO1A,
75 V34_RX_STAGE_TONE_A,
76 V34_RX_STAGE_TONE_B,
77 V34_RX_STAGE_L1_L2,
78 V34_RX_STAGE_CC,
79 V34_RX_STAGE_PRIMARY_CHANNEL
80};
81
82enum v34_tx_stages_e
83{
84 /*! \brief An initial bit of extra preamble ahead of the first INFO0, to ensure
85 bit synchronisation is OK by the first bit of INFO0 */
86 V34_TX_STAGE_INITIAL_PREAMBLE = 1,
87 /*! \brief INFO0 is being transmitted the first time */
88 V34_TX_STAGE_INFO0,
89 /*! \brief Transmitting A while waiting for 50ms timeout */
90 V34_TX_STAGE_INITIAL_A,
91 /*! \brief Transmitting A while waiting for received INFO0c */
92 V34_TX_STAGE_FIRST_A,
93 V34_TX_STAGE_FIRST_NOT_A,
94 V34_TX_STAGE_FIRST_NOT_A_REVERSAL_SEEN,
95 V34_TX_STAGE_SECOND_A,
96 /*! \brief L1 is being transmitted */
97 V34_TX_STAGE_L1,
98 /*! \brief L2 is being transmitted */
99 V34_TX_STAGE_L2,
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,
104 /*! \brief INFO1 is being trasnmitted */
105 V34_TX_STAGE_INFO1,
106
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,
116 /*! \brief INFO0 is being resent on a bad startup */
117 V34_TX_STAGE_INFO0_RETRY,
118
119 V34_TX_STAGE_FIRST_S,
120 V34_TX_STAGE_FIRST_NOT_S,
121 /*! \brief The optional MD is being transmitted */
122 V34_TX_STAGE_MD,
123 V34_TX_STAGE_SECOND_S,
124 V34_TX_STAGE_SECOND_NOT_S,
125 /*! \brief TRN is being transmitted */
126 V34_TX_STAGE_TRN,
127 /*! \brief J is being transmitted */
128 V34_TX_STAGE_J,
129 /*! \brief J' is being transmitted */
130 V34_TX_STAGE_J_DASHED,
131 /*! \brief MP is being transmitted */
132 V34_TX_STAGE_MP,
133
134 /*! \brief Half-duplex initial stages */
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,
141
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,
148
149 /*! \brief Half-duplex control channel stages */
150 /*! \brief Sh and !Sh are being transmitted */
151 V34_TX_STAGE_HDX_SH,
152 /*! \brief The first ALT is being transmitted */
153 V34_TX_STAGE_HDX_FIRST_ALT,
154 /*! \brief The PPh is being transmitted */
155 V34_TX_STAGE_HDX_PPH,
156 /*! \brief The second ALT is being transmitted */
157 V34_TX_STAGE_HDX_SECOND_ALT,
158 /*! \brief MPh is being transmitted */
159 V34_TX_STAGE_HDX_MPH,
160 /*! \brief E is being transmitted */
161 V34_TX_STAGE_HDX_E
162};
163
164enum v34_events_e
165{
166 V34_EVENT_NONE = 0,
167 V34_EVENT_TONE_SEEN,
168 V34_EVENT_REVERSAL_1,
169 V34_EVENT_REVERSAL_2,
170 V34_EVENT_REVERSAL_3,
171 V34_EVENT_INFO0_OK,
172 V34_EVENT_INFO0_BAD,
173 V34_EVENT_INFO1_OK,
174 V34_EVENT_INFO1_BAD,
175 V34_EVENT_INFOH_OK,
176 V34_EVENT_INFOH_BAD,
177 V34_EVENT_L2_SEEN,
178 V34_EVENT_S
179};
180
181typedef struct
182{
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;
189 bool from_cme_modem;
190 bool rate_3429_allowed;
192
193typedef struct
194{
195 int use_high_carrier;
196 int pre_emphasis;
197 int max_data_rate;
199
200typedef struct
201{
202 int power_reduction;
203 int additional_power_reduction;
204 int md;
205 int freq_offset;
206 info1c_baud_rate_parms_t rate_data[6];
207} info1c_t;
208
209typedef struct
210{
211 int power_reduction;
212 int additional_power_reduction;
213 int md;
214 int freq_offset;
215 int use_high_carrier;
216 int preemphasis_filter;
217 int max_data_rate;
218 int baud_rate_a_to_c;
219 int baud_rate_c_to_a;
220} info1a_t;
221
222typedef struct
223{
224 int power_reduction;
225 int length_of_trn;
226 int use_high_carrier;
227 int preemphasis_filter;
228 int baud_rate;
229 bool trn16;
230} infoh_t;
231
232typedef struct
233{
234 int type;
235 int baud_rate_a_to_c;
236 int baud_rate_c_to_a;
237 int aux_channel_supported;
238 int trellis_size;
239 int use_non_linear_encoder;
240 int expanded_shaping;
241 int mp_acknowledged;
242 int signalling_rate_mask;
243 int asymmetric_rates_allowed;
244 /*! \brief Only in an MP1 message */
245 complexi16_t precoder_coeffs[3];
246} mp_t;
247
248typedef struct
249{
250 int type;
251 int max_data_rate;
252 int control_channel_2400;
253 int trellis_size;
254 int use_non_linear_encoder;
255 int expanded_shaping;
256 int signalling_rate_mask;
257 int asymmetric_rates_allowed;
258 /*! \brief Only in an MPH1 message */
259 complexi16_t precoder_coeffs[3];
260} mph_t;
261
262/*! The set of working parameters, which defines operation at the current settings */
263typedef struct
264{
265 int max_bit_rate;
266 /*! \brief Parameters for the current bit rate and baud rate */
268 /*! \brief Bits per high mapping frame. A low mapping frame is one bit less. */
269 int b;
270 int j;
271 /*! \brief The number of shell mapped bits */
272 int k;
273 int l;
274 int m;
275 int p;
276 /*! \brief The number of uncoded Q bits per 2D symbol */
277 int q;
278 int q_mask;
279 /*! \brief Mapping frame switching parameter */
280 int r;
281 int w;
282 /*! The numerator of the number of samples per symbol ratio. */
284 /*! The denominator of the number of samples per symbol ratio. */
287
288typedef struct
289{
290 /*! \brief True if this is the calling side modem. */
292 /*! \brief True if this is a full duplex modem. */
293 bool duplex;
294 /*! The current source end when in half-duplex mode */
296 /*! The current operating state when in half-duplex mode */
298 /*! \brief */
299 int bit_rate;
300 /*! \brief The callback function used to get the next bit to be transmitted. */
301 get_bit_func_t get_bit;
302 /*! \brief A user specified opaque pointer passed to the get_bit function. */
304
305 /*! \brief The callback function used to get the next aux channel bit to be transmitted. */
306 get_bit_func_t get_aux_bit;
307 /*! \brief A user specified opaque pointer passed to the get_aux_bit function. */
309
310 /*! \brief The current baud rate selection, as a value from 0 to 5. */
312 /*! \brief True if using the higher of the two carrier frequency options. */
314
315 /*! \brief The register for the data scrambler. */
316 uint32_t scramble_reg;
317 /*! \brief The scrambler tap which selects between the caller and answerer scramblers */
319
320#if defined(SPANDSP_USE_FIXED_POINT)
321 complexi16_t (*current_getbaud)(v34_state_t *s);
322#else
323 complexf_t (*current_getbaud)(v34_state_t *s);
324#endif
325
326 /*! \brief Mapping frame parsed input */
327 uint32_t r0;
328 uint16_t qbits[8];
329 uint16_t ibits[4];
330
331 /*! \brief (x0,y0) (x1,y1)... */
332 int mjk[8];
333
334 int step_2d;
335
337 uint32_t bitstream;
338
339 int i;
340
341 /*! \brief Parameters for the current bit rate and baud rate */
343
344 /*! \brief We need to remember some old x values
345 in the C code: x[0] x[1] x[2] x[3] x[4] x[5] x[6] x[7] x[8] x[9] x[10]
346 in V.34: x[-3] x[-2] x[-1] x[0] x[1] x[2] x[3] x[4] x[5] x[6] x[7] */
347 complexi16_t x[8 + V34_XOFF];
348 /*! \brief Precoder coefficients */
349 complexi16_t precoder_coeffs[3];
350
351 complexi16_t c;
352 complexi16_t p;
353 int z;
354 int y0;
355 int state;
356
357#if defined(SPANDSP_USE_FIXED_POINT)
358 int16_t gain;
359#else
360 float gain;
361#endif
362
363#if defined(SPANDSP_USE_FIXED_POINT)
364 /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
365 int16_t rrc_filter_re[V34_INFO_TX_FILTER_STEPS];
366 int16_t rrc_filter_im[V34_INFO_TX_FILTER_STEPS];
367 complexi16_t lastbit;
368#else
369 /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
370 float rrc_filter_re[V34_INFO_TX_FILTER_STEPS];
371 float rrc_filter_im[V34_INFO_TX_FILTER_STEPS];
372 complexf_t lastbit;
373#endif
374 /*! \brief Current offset into the RRC pulse shaping filter buffer. */
376
377 /*! \brief The current phase of the carrier (i.e. the DDS parameter). */
379 /*! \brief The update rate for the phase of the control channel carrier (i.e. the DDS increment). */
381 /*! \brief The update rate for the phase of the V.34 carrier (i.e. the DDS increment). */
383
384 /*! \brief The current phase of the guard tone (i.e. the DDS parameter). */
385 uint32_t guard_phase;
386 /*! \brief The update rate for the phase of the guard tone (i.e. the DDS increment). */
388 /*! \brief Guard tone signal level. */
390 /*! \brief The current fractional phase of the baud timing. */
392
393 int stage;
394 int convolution;
395 int training_stage;
396 int current_modulator;
397 int diff;
398
399 int line_probe_cycles;
400 int line_probe_step;
401 float line_probe_scaling;
402 int tone_duration;
403
404 int super_frame;
405 int data_frame;
406 int s_bit_cnt;
407 int aux_bit_cnt;
408
409 uint8_t txbuf[50];
410 int txbits;
411 int txptr;
412 const conv_encode_table_t *conv_encode_table;
413
414 bool info0_acknowledgement;
415
416 union
417 {
418 info1a_t info1a;
419 info1c_t info1c;
420 infoh_t infoh;
421 };
422 union
423 {
424 mp_t mp;
425 mph_t mph;
426 };
427
428 int fred1;
429 int fred2;
430
431 /*! \brief The get_bit function in use at any instant. */
432 get_bit_func_t current_get_bit;
433 logging_state_t *logging;
435
436typedef struct
437{
438#if defined(SPANDSP_USE_FIXED_POINT)
439 /*! \brief Low band edge filter for symbol sync. */
440 int32_t symbol_sync_low[2];
441 /*! \brief High band edge filter for symbol sync. */
442 int32_t symbol_sync_high[2];
443 /*! \brief DC filter for symbol sync. */
444 int32_t symbol_sync_dc_filter[2];
445 /*! \brief Baud phase for symbol sync. */
446 int32_t baud_phase;
447
448 /*! \brief Low band edge filter coefficients for symbol sync. */
449 int32_t low_band_edge_coeff[3];
450 /*! \brief High band edge filter coefficients for symbol sync. */
451 int32_t high_band_edge_coeff[3];
452 /*! \brief A coefficient common to the low and high band edges */
453 int32_t mixed_edges_coeff_3;
454#else
455 /*! \brief Low band edge filter for symbol sync. */
456 float symbol_sync_low[2];
457 /*! \brief High band edge filter for symbol sync. */
458 float symbol_sync_high[2];
459 /*! \brief DC filter for symbol sync. */
460 float symbol_sync_dc_filter[2];
461 /*! \brief Baud phase for symbol sync. */
463
464 /*! \brief Low band edge filter coefficients for symbol sync. */
465 float low_band_edge_coeff[3];
466 /*! \brief High band edge filter coefficients for symbol sync. */
467 float high_band_edge_coeff[3];
468 /*! \brief A coefficient common to the low and high band edges */
470#endif
471} ted_t;
472
473typedef struct
474{
475 /*! \brief Viterbi trellis state table
476 16 4D symbols deep, with 16 states each
477 Each state has 4 entries: cumulative path metric, and prev. path pointer, x, y
478 circularly addressed */
479 /*! \brief Cumulative path metric */
480 uint32_t cumulative_path_metric[16][16];
481 /*! \brief Previous path pointer */
482 uint16_t previous_path_ptr[16][16];
483 uint16_t pts[16][16];
484 /*! \brief Latest viterbi table slot. */
485 int ptr;
486 /*! \brief Countdown to the first data being available from the viterbi pipeline */
488 int16_t curr_min_state;
489
490 int16_t error[2][4];
491
492 /*! \brief Eight 4D squared branch errors for each of 8 4D subsets.
493 Indexed array for indexing from viterbi lookup table */
494 uint16_t branch_error[8];
495 uint16_t branch_error_x[16][8];
496
497 /*! \brief Branches of the x and y coords of the points in the eight 4D subsets
498 to which a sequence of 2D points has been sliced.
499 indexed from 0 to 15 --> 8 points for 16 past 4D symbols */
500 complexi16_t bb[2][16][8];
501
502 const conv_decode_table_t *conv_decode_table;
503} viterbi_t;
504
505typedef struct
506{
507 /*! \brief True if this is the calling side modem. */
509 /*! \brief True if this is a full duplex modem. */
510 bool duplex;
511 /*! The current source end when in half-duplex mode */
513 /*! The current operating state when in half-duplex mode */
515 /*! \brief */
516 int bit_rate;
517 /*! \brief The callback function used to put each bit received. */
518 put_bit_func_t put_bit;
519 /*! \brief A user specified opaque pointer passed to the put_bit routine. */
521
522 /*! \brief The callback function used to put each aux bit received. */
523 put_bit_func_t put_aux_bit;
524 /*! \brief A user specified opaque pointer passed to the put_aux_bit routine. */
526
527 /*! \brief A callback function which may be enabled to report every symbol's
528 constellation position. */
529 qam_report_handler_t qam_report;
530 /*! \brief A user specified opaque pointer passed to the qam_report callback
531 routine. */
533
534 /*! \brief The current baud rate selection, as a value from 0 to 5. */
536 /*! \brief True if using the higher of the two carrier frequency options. */
538
539 int stage;
540 int received_event;
541
542 /*! \brief The register for the data scrambler. */
543 uint32_t scramble_reg;
544 /*! \brief The scrambler tap which selects between the caller and answerer scramblers */
546
547 /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */
549 /*! \brief The power meter level at which carrier on is declared. */
551 /*! \brief The power meter level at which carrier off is declared. */
553 bool signal_present;
554
556 uint32_t bitstream;
557
558 /*! \brief Mapping frame output */
559 uint32_t r0;
560 uint16_t qbits[8];
561 uint16_t ibits[4];
562
563 /*! \brief (x0,y0) (x1,y1)... */
564 int mjk[8];
565
566 int step_2d;
567
568 /*! \brief Parameters for the current bit rate and baud rate */
570
571 /*! \brief yt's are the noise corrupted points fed to the viterbi decoder.
572 Assumed to have format 9:7 (7 fractional bits) */
574 complexi16_t xt[4];
575
576 complexi16_t x[3];
577 complexi16_t h[3];
578
579 /*! \brief These are quantized points in the respective 2D coset (0,1,2,3) */
580 complexi16_t xy[2][4];
581
582 viterbi_t viterbi;
583
584 /*! \brief ww contains old z, current z and current w */
585 int16_t ww[3];
586
587 /*! \brief The current phase of the carrier (i.e. the DDS parameter). */
589 /*! \brief The carrier update rate saved for reuse when using short training. */
591
592 /*! \brief The update rate for the phase of the control channel carrier (i.e. the DDS increment). */
594 /*! \brief The update rate for the phase of the V.34 carrier (i.e. the DDS increment). */
596
597 /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
598#if defined(SPANDSP_USE_FIXED_POINT)
599 int16_t rrc_filter[V34_RX_FILTER_STEPS];
600#else
601 float rrc_filter[V34_RX_FILTER_STEPS];
602#endif
603 /*! \brief Current offset into the RRC pulse shaping filter buffer. */
605 /*! \brief Current read offset into the equalizer buffer. */
607 /*! \brief Current write offset into the equalizer buffer. */
609 int shaper_sets;
610
611#if defined(SPANDSP_USE_FIXED_POINT)
612 /*! \brief The scaling factor assessed by the AGC algorithm. */
613 int16_t agc_scaling;
614 /*! \brief The previous value of agc_scaling, needed to reuse old training. */
615 int16_t agc_scaling_save;
616#else
617 /*! \brief The scaling factor assessed by the AGC algorithm. */
619 /*! \brief The previous value of agc_scaling, needed to reuse old training. */
621#endif
622 ted_t pri_ted;
623 ted_t cc_ted;
624
625#if defined(SPANDSP_USE_FIXED_POINT)
626 /*! \brief The proportional part of the carrier tracking filter. */
627 float carrier_track_p;
628 /*! \brief The integral part of the carrier tracking filter. */
629 float carrier_track_i;
630#else
631 /*! \brief The proportional part of the carrier tracking filter. */
633 /*! \brief The integral part of the carrier tracking filter. */
635#endif
636
637 const v34_rx_shaper_t *shaper_re;
638 const v34_rx_shaper_t *shaper_im;
639
640 /*! \brief The total symbol timing correction since the carrier came up.
641 This is only for performance analysis purposes. */
643
644 /*! \brief The current half of the baud. */
646 /*! \brief The measured round trip delay estimate, in sample times */
648
649 int duration;
650 int bit_count;
651 int target_bits;
652 uint16_t crc;
653 uint32_t last_angles[2];
654
655 /*! \brief Buffer for receiving info frames. */
656 uint8_t info_buf[25];
657
658 int super_frame;
659 int data_frame;
660 int s_bit_cnt;
661 int aux_bit_cnt;
662
663 uint8_t rxbuf[50];
664 int rxbits;
665 int rxptr;
666
667 int blip_duration;
668
669 v34_capabilities_t far_capabilities;
670
671 /*! \brief Whether or not a carrier drop was detected and the signal delivery is pending. */
673 /*! \brief A count of the current consecutive samples below the carrier off threshold. */
675 /*! \brief A highest magnitude sample seen. */
676 int16_t high_sample;
677
678 bool info0_acknowledgement;
679
680 union
681 {
682 info1a_t info1a;
683 info1c_t info1c;
684 infoh_t infoh;
685 };
686
687 int step;
688 int fred1;
689 int fred2;
690
691 /* MP or MPh receive tracking data */
692 int mp_count;
693 int mp_len;
694 int mp_and_fill_len;
695 int mp_seen;
696
697 int dft_ptr;
698#if defined(SPANDSP_USE_FIXED_POINT)
699 int16_t dft_buffer[160];
700 int32_t l1_l2_gains[25];
701 int32_t l1_l2_phases[25];
702 int32_t base_phase;
703 complexf_t last_sample;
704 #else
705 complexf_t dft_buffer[160];
706 float l1_l2_gains[25];
707 float l1_l2_phases[25];
708 float base_phase;
709 complexf_t last_sample;
710#endif
711 int l1_l2_duration;
712
713 int current_demodulator;
714
715 logging_state_t *logging;
717
718/*!
719 V.34 modem descriptor. This defines the working state for a single instance
720 of a V.34 modem.
721*/
723{
724 /*! \brief True if this is the calling side modem. */
726 /*! \brief True if this is a full duplex modem. */
727 bool duplex;
728 /*! The current source end when in half-duplex mode */
730 /*! The current operating state when in half-duplex mode */
732 /*! \brief The bit rate of the modem. Valid values are 1200 and 2400. */
734
737
738 /*! \brief Error and flow logging control */
740};
741
742#endif
743/*- End of file ------------------------------------------------------------*/
Definition private/bitstream.h:31
Definition complex.h:43
Definition complex.h:89
Definition private/v34.h:210
Definition private/v34.h:194
Definition private/v34.h:201
Definition private/v34.h:223
Definition private/logging.h:34
Definition private/v34.h:233
Definition private/v34.h:249
Definition private/power_meter.h:34
Definition private/v34.h:437
float baud_phase
Baud phase for symbol sync.
Definition private/v34.h:462
float mixed_edges_coeff_3
A coefficient common to the low and high band edges.
Definition private/v34.h:469
Definition private/v34.h:182
Definition private/v34.h:264
int k
The number of shell mapped bits.
Definition private/v34.h:272
int samples_per_symbol_numerator
Definition private/v34.h:283
int b
Bits per high mapping frame. A low mapping frame is one bit less.
Definition private/v34.h:269
int bit_rate
Parameters for the current bit rate and baud rate.
Definition private/v34.h:267
int samples_per_symbol_denominator
Definition private/v34.h:285
int r
Mapping frame switching parameter.
Definition private/v34.h:280
int q
The number of uncoded Q bits per 2D symbol.
Definition private/v34.h:277
Definition private/v34.h:506
uint32_t r0
Mapping frame output.
Definition private/v34.h:559
put_bit_func_t put_aux_bit
The callback function used to put each aux bit received.
Definition private/v34.h:523
uint32_t carrier_phase
The current phase of the carrier (i.e. the DDS parameter).
Definition private/v34.h:588
bool high_carrier
True if using the higher of the two carrier frequency options.
Definition private/v34.h:537
int baud_half
The current half of the baud.
Definition private/v34.h:645
int baud_rate
The current baud rate selection, as a value from 0 to 5.
Definition private/v34.h:535
v34_parameters_t parms
Parameters for the current bit rate and baud rate.
Definition private/v34.h:569
float agc_scaling
The scaling factor assessed by the AGC algorithm.
Definition private/v34.h:618
float carrier_track_i
The integral part of the carrier tracking filter.
Definition private/v34.h:634
int carrier_drop_pending
Whether or not a carrier drop was detected and the signal delivery is pending.
Definition private/v34.h:672
qam_report_handler_t qam_report
A callback function which may be enabled to report every symbol's constellation position.
Definition private/v34.h:529
int eq_put_step
Current write offset into the equalizer buffer.
Definition private/v34.h:608
int32_t carrier_off_power
The power meter level at which carrier off is declared.
Definition private/v34.h:552
int round_trip_delay_estimate
The measured round trip delay estimate, in sample times.
Definition private/v34.h:647
uint32_t scramble_reg
The register for the data scrambler.
Definition private/v34.h:543
void * put_bit_user_data
A user specified opaque pointer passed to the put_bit routine.
Definition private/v34.h:520
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:642
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:595
bool calling_party
True if this is the calling side modem.
Definition private/v34.h:508
int eq_step
Current read offset into the equalizer buffer.
Definition private/v34.h:606
bool half_duplex_source
Definition private/v34.h:512
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:573
int rrc_filter_step
Current offset into the RRC pulse shaping filter buffer.
Definition private/v34.h:604
float carrier_track_p
The proportional part of the carrier tracking filter.
Definition private/v34.h:632
int16_t high_sample
A highest magnitude sample seen.
Definition private/v34.h:676
int scrambler_tap
The scrambler tap which selects between the caller and answerer scramblers.
Definition private/v34.h:545
bool half_duplex_state
Definition private/v34.h:514
power_meter_t power
A power meter, to measure the HPF'ed signal power in the channel.
Definition private/v34.h:548
int32_t carrier_on_power
The power meter level at which carrier on is declared.
Definition private/v34.h:550
void * qam_user_data
A user specified opaque pointer passed to the qam_report callback routine.
Definition private/v34.h:532
int low_samples
A count of the current consecutive samples below the carrier off threshold.
Definition private/v34.h:674
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:593
void * put_aux_bit_user_data
A user specified opaque pointer passed to the put_aux_bit routine.
Definition private/v34.h:525
float agc_scaling_save
The previous value of agc_scaling, needed to reuse old training.
Definition private/v34.h:620
bool duplex
True if this is a full duplex modem.
Definition private/v34.h:510
int32_t carrier_phase_rate_save
The carrier update rate saved for reuse when using short training.
Definition private/v34.h:590
put_bit_func_t put_bit
The callback function used to put each bit received.
Definition private/v34.h:518
Definition private/v34.h:723
bool calling_party
True if this is the calling side modem.
Definition private/v34.h:725
bool duplex
True if this is a full duplex modem.
Definition private/v34.h:727
logging_state_t logging
Error and flow logging control.
Definition private/v34.h:739
int bit_rate
The bit rate of the modem. Valid values are 1200 and 2400.
Definition private/v34.h:733
bool half_duplex_source
Definition private/v34.h:729
bool half_duplex_state
Definition private/v34.h:731
Definition private/v34.h:289
get_bit_func_t current_get_bit
The get_bit function in use at any instant.
Definition private/v34.h:432
void * get_aux_bit_user_data
A user specified opaque pointer passed to the get_aux_bit function.
Definition private/v34.h:308
int scrambler_tap
The scrambler tap which selects between the caller and answerer scramblers.
Definition private/v34.h:318
bool calling_party
True if this is the calling side modem.
Definition private/v34.h:291
bool high_carrier
True if using the higher of the two carrier frequency options.
Definition private/v34.h:313
int baud_rate
The current baud rate selection, as a value from 0 to 5.
Definition private/v34.h:311
uint32_t guard_phase
The current phase of the guard tone (i.e. the DDS parameter).
Definition private/v34.h:385
uint32_t scramble_reg
The register for the data scrambler.
Definition private/v34.h:316
v34_parameters_t parms
Parameters for the current bit rate and baud rate.
Definition private/v34.h:342
void * get_bit_user_data
A user specified opaque pointer passed to the get_bit function.
Definition private/v34.h:303
get_bit_func_t get_bit
The callback function used to get the next bit to be transmitted.
Definition private/v34.h:301
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:380
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:306
bool duplex
True if this is a full duplex modem.
Definition private/v34.h:293
int32_t guard_phase_rate
The update rate for the phase of the guard tone (i.e. the DDS increment).
Definition private/v34.h:387
uint32_t r0
Mapping frame parsed input.
Definition private/v34.h:327
int rrc_filter_step
Current offset into the RRC pulse shaping filter buffer.
Definition private/v34.h:375
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:382
bool half_duplex_source
Definition private/v34.h:295
int baud_phase
The current fractional phase of the baud timing.
Definition private/v34.h:391
bool half_duplex_state
Definition private/v34.h:297
uint32_t carrier_phase
The current phase of the carrier (i.e. the DDS parameter).
Definition private/v34.h:378
float guard_level
Guard tone signal level.
Definition private/v34.h:389
Definition private/v34.h:474
int windup
Countdown to the first data being available from the viterbi pipeline.
Definition private/v34.h:487
int ptr
Latest viterbi table slot.
Definition private/v34.h:485