spandsp 3.0.0
private/v29tx.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/v29tx.h - ITU V.29 modem transmit part
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2003 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_V29TX_H_)
27#define _SPANDSP_PRIVATE_V29TX_H_
28
29/*! The number of taps in the pulse shaping/bandpass filter */
30#define V29_TX_FILTER_STEPS 9
31
32/*!
33 V.29 modem transmit side descriptor. This defines the working state for a
34 single instance of a V.29 modem transmitter.
35*/
37{
38 /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */
40 /*! \brief The callback function used to get the next bit to be transmitted. */
42 /*! \brief A user specified opaque pointer passed to the get_bit function. */
44
45 /*! \brief The callback function used to report modem status changes. */
47 /*! \brief A user specified opaque pointer passed to the status function. */
49
50#if defined(SPANDSP_USE_FIXED_POINT)
51 /*! \brief Gain required to achieve the specified output power, not allowing
52 for the size of the current constellation. */
53 int16_t base_gain;
54 /*! \brief Gain required to achieve the specified output power, allowing
55 for the size of the current constellation. */
56 int16_t gain;
57 /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
58 int16_t rrc_filter_re[V29_TX_FILTER_STEPS];
59 int16_t rrc_filter_im[V29_TX_FILTER_STEPS];
60#else
61 /*! \brief Gain required to achieve the specified output power, not allowing
62 for the size of the current constellation. */
63 float base_gain;
64 /*! \brief Gain required to achieve the specified output power, allowing
65 for the size of the current constellation. */
66 float gain;
67 /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
68 float rrc_filter_re[V29_TX_FILTER_STEPS];
69 float rrc_filter_im[V29_TX_FILTER_STEPS];
70#endif
71
72 /*! \brief Current offset into the RRC pulse shaping filter buffer. */
74
75 /*! \brief The register for the data scrambler. */
76 uint32_t scramble_reg;
77 /*! \brief The register for the training scrambler. */
79 /*! \brief True if transmitting the training sequence, or shutting down transmission.
80 False if transmitting user data. */
82 /*! \brief A counter used to track progress through sending the training sequence. */
84 /*! \brief An offset value into the table of training parameters, used to match the
85 training pattern to the bit rate. */
87
88 /*! \brief The current phase of the carrier (i.e. the DDS parameter). */
89 uint32_t carrier_phase;
90 /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */
92 /*! \brief The current fractional phase of the baud timing. */
94 /*! \brief The code number for the current position in the constellation. */
96 /*! \brief The get_bit function in use at any instant. */
98 /*! \brief Error and flow logging control */
100};
101
102#endif
103/*- End of file ------------------------------------------------------------*/
void(* modem_status_func_t)(void *user_data, int status)
Definition async.h:113
int(* get_bit_func_t)(void *user_data)
Definition async.h:110
Definition private/logging.h:34
Definition private/v29tx.h:37
uint8_t training_scramble_reg
The register for the training scrambler.
Definition private/v29tx.h:78
uint32_t carrier_phase
The current phase of the carrier (i.e. the DDS parameter).
Definition private/v29tx.h:89
int baud_phase
The current fractional phase of the baud timing.
Definition private/v29tx.h:93
get_bit_func_t get_bit
The callback function used to get the next bit to be transmitted.
Definition private/v29tx.h:41
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition private/v29tx.h:48
void * get_bit_user_data
A user specified opaque pointer passed to the get_bit function.
Definition private/v29tx.h:43
int rrc_filter_step
Current offset into the RRC pulse shaping filter buffer.
Definition private/v29tx.h:73
bool in_training
True if transmitting the training sequence, or shutting down transmission. False if transmitting user...
Definition private/v29tx.h:81
int32_t carrier_phase_rate
The update rate for the phase of the carrier (i.e. the DDS increment).
Definition private/v29tx.h:91
logging_state_t logging
Error and flow logging control.
Definition private/v29tx.h:99
int training_offset
An offset value into the table of training parameters, used to match the training pattern to the bit ...
Definition private/v29tx.h:86
float rrc_filter_re[9]
The root raised cosine (RRC) pulse shaping filter buffer.
Definition private/v29tx.h:68
int training_step
A counter used to track progress through sending the training sequence.
Definition private/v29tx.h:83
float base_gain
Gain required to achieve the specified output power, not allowing for the size of the current constel...
Definition private/v29tx.h:63
float gain
Gain required to achieve the specified output power, allowing for the size of the current constellati...
Definition private/v29tx.h:66
int bit_rate
The bit rate of the modem. Valid values are 4800, 7200 and 9600.
Definition private/v29tx.h:39
uint32_t scramble_reg
The register for the data scrambler.
Definition private/v29tx.h:76
int constellation_state
The code number for the current position in the constellation.
Definition private/v29tx.h:95
modem_status_func_t status_handler
The callback function used to report modem status changes.
Definition private/v29tx.h:46
get_bit_func_t current_get_bit
The get_bit function in use at any instant.
Definition private/v29tx.h:97