spandsp  0.0.6
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. */
39  int bit_rate;
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  /*! \brief Gain required to achieve the specified output power, not allowing
51  for the size of the current constellation. */
52  float base_gain;
53  /*! \brief Gain required to achieve the specified output power, allowing
54  for the size of the current constellation. */
55 #if defined(SPANDSP_USE_FIXED_POINT)
56  int32_t gain;
57 #else
58  float gain;
59 #endif
60 
61  /*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */
62 #if defined(SPANDSP_USE_FIXED_POINT)
63  complexi16_t rrc_filter[2*V29_TX_FILTER_STEPS];
64 #else
65  complexf_t rrc_filter[2*V29_TX_FILTER_STEPS];
66 #endif
67  /*! \brief Current offset into the RRC pulse shaping filter buffer. */
69 
70  /*! \brief The register for the data scrambler. */
71  unsigned int scramble_reg;
72  /*! \brief The register for the training scrambler. */
74  /*! \brief TRUE if transmitting the training sequence, or shutting down transmission.
75  FALSE if transmitting user data. */
77  /*! \brief A counter used to track progress through sending the training sequence. */
79  /*! \brief An offset value into the table of training parameters, used to match the
80  training pattern to the bit rate. */
82 
83  /*! \brief The current phase of the carrier (i.e. the DDS parameter). */
84  uint32_t carrier_phase;
85  /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */
87  /*! \brief The current fractional phase of the baud timing. */
89  /*! \brief The code number for the current position in the constellation. */
91  /*! \brief The get_bit function in use at any instant. */
93  /*! \brief Error and flow logging control */
95 };
96 
97 #endif
98 /*- End of file ------------------------------------------------------------*/