spandsp  3.0.0
private/v17tx.h
Go to the documentation of this file.
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/v17tx.h - ITU V.17 modem transmit part
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2004 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 /*! \file */
27 
28 #if !defined(_SPANDSP_PRIVATE_V17TX_H_)
29 #define _SPANDSP_PRIVATE_V17TX_H_
30 
31 /*! The number of taps in the pulse shaping/bandpass filter */
32 #define V17_TX_FILTER_STEPS 9
33 
34 /*!
35  V.17 modem transmit side descriptor. This defines the working state for a
36  single instance of a V.17 modem transmitter.
37 */
39 {
40  /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */
41  int bit_rate;
42  /*! \brief The callback function used to get the next bit to be transmitted. */
44  /*! \brief A user specified opaque pointer passed to the get_bit function. */
46 
47  /*! \brief The callback function used to report modem status changes. */
49  /*! \brief A user specified opaque pointer passed to the status function. */
51 
52 #if defined(SPANDSP_USE_FIXED_POINT)
53  /*! \brief The gain factor needed to achieve the specified output power. */
54  int16_t gain;
55  /*! \brief A pointer to the constellation currently in use. */
57  /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
59  int16_t rrc_filter_im[V17_TX_FILTER_STEPS];
60 #else
61  /*! \brief The gain factor needed to achieve the specified output power. */
62  float gain;
63  /*! \brief A pointer to the constellation currently in use. */
65  /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
66  float rrc_filter_re[V17_TX_FILTER_STEPS];
67  float rrc_filter_im[V17_TX_FILTER_STEPS];
68 #endif
69 
70  /*! \brief Current offset into the RRC pulse shaping filter buffer. */
72 
73  /*! \brief The current state of the differential encoder. */
74  int diff;
75  /*! \brief The current state of the convolutional encoder. */
77  /*! \brief The code number for the current position in the constellation. */
79 
80  /*! \brief The register for the data scrambler. */
81  uint32_t scramble_reg;
82  /*! \brief Scrambler tap */
84  /*! \brief True if transmitting the training sequence. False if transmitting user data. */
86  /*! \brief True if the short training sequence is to be used. */
88  /*! \brief A counter used to track progress through sending the training sequence. */
90 
91  /*! \brief The current phase of the carrier (i.e. the DDS parameter). */
92  uint32_t carrier_phase;
93  /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */
95  /*! \brief The current fractional phase of the baud timing. */
97 
98  /*! \brief The current number of data bits per symbol. This does not include
99  the redundant bit. */
101  /*! \brief The get_bit function in use at any instant. */
103  /*! \brief Error and flow logging control */
105 };
106 
107 #endif
108 /*- End of file ------------------------------------------------------------*/
float gain
The gain factor needed to achieve the specified output power.
Definition: private/v17tx.h:62
int diff
The current state of the differential encoder.
Definition: private/v17tx.h:74
const complexf_t * constellation
A pointer to the constellation currently in use.
Definition: private/v17tx.h:64
logging_state_t logging
Error and flow logging control.
Definition: private/v17tx.h:104
get_bit_func_t current_get_bit
The get_bit function in use at any instant.
Definition: private/v17tx.h:102
Definition: complex.h:88
int bit_rate
The bit rate of the modem. Valid values are 4800, 7200 and 9600.
Definition: private/v17tx.h:41
int training_step
A counter used to track progress through sending the training sequence.
Definition: private/v17tx.h:89
int convolution
The current state of the convolutional encoder.
Definition: private/v17tx.h:76
uint32_t carrier_phase
The current phase of the carrier (i.e. the DDS parameter).
Definition: private/v17tx.h:92
Definition: private/v17tx.h:38
float rrc_filter_re[9]
The root raised cosine (RRC) pulse shaping filter buffer.
Definition: private/v17tx.h:66
bool short_train
True if the short training sequence is to be used.
Definition: private/v17tx.h:87
int rrc_filter_step
Current offset into the RRC pulse shaping filter buffer.
Definition: private/v17tx.h:71
modem_status_func_t status_handler
The callback function used to report modem status changes.
Definition: private/v17tx.h:48
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
int bits_per_symbol
The current number of data bits per symbol. This does not include the redundant bit.
Definition: private/v17tx.h:100
bool in_training
True if transmitting the training sequence. False if transmitting user data.
Definition: private/v17tx.h:85
get_bit_func_t get_bit
The callback function used to get the next bit to be transmitted.
Definition: private/v17tx.h:43
#define V17_TX_FILTER_STEPS
Definition: private/v17tx.h:32
Definition: complex.h:42
Definition: private/logging.h:33
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition: private/v17tx.h:50
int constellation_state
The code number for the current position in the constellation.
Definition: private/v17tx.h:78
int scrambler_tap
Scrambler tap.
Definition: private/v17tx.h:83
void * get_bit_user_data
A user specified opaque pointer passed to the get_bit function.
Definition: private/v17tx.h:45
int baud_phase
The current fractional phase of the baud timing.
Definition: private/v17tx.h:96
int32_t carrier_phase_rate
The update rate for the phase of the carrier (i.e. the DDS increment).
Definition: private/v17tx.h:94
uint32_t scramble_reg
The register for the data scrambler.
Definition: private/v17tx.h:81