00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * private/v29tx.h - ITU V.29 modem transmit part 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2003 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 */ 00025 00026 #if !defined(_SPANDSP_PRIVATE_V29TX_H_) 00027 #define _SPANDSP_PRIVATE_V29TX_H_ 00028 00029 /*! The number of taps in the pulse shaping/bandpass filter */ 00030 #define V29_TX_FILTER_STEPS 9 00031 00032 /*! 00033 V.29 modem transmit side descriptor. This defines the working state for a 00034 single instance of a V.29 modem transmitter. 00035 */ 00036 struct v29_tx_state_s 00037 { 00038 /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */ 00039 int bit_rate; 00040 /*! \brief The callback function used to get the next bit to be transmitted. */ 00041 get_bit_func_t get_bit; 00042 /*! \brief A user specified opaque pointer passed to the get_bit function. */ 00043 void *get_bit_user_data; 00044 00045 /*! \brief The callback function used to report modem status changes. */ 00046 modem_status_func_t status_handler; 00047 /*! \brief A user specified opaque pointer passed to the status function. */ 00048 void *status_user_data; 00049 00050 #if defined(SPANDSP_USE_FIXED_POINT) 00051 /*! \brief Gain required to achieve the specified output power, not allowing 00052 for the size of the current constellation. */ 00053 int16_t base_gain; 00054 /*! \brief Gain required to achieve the specified output power, allowing 00055 for the size of the current constellation. */ 00056 int16_t gain; 00057 /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ 00058 int16_t rrc_filter_re[V29_TX_FILTER_STEPS]; 00059 int16_t rrc_filter_im[V29_TX_FILTER_STEPS]; 00060 #else 00061 /*! \brief Gain required to achieve the specified output power, not allowing 00062 for the size of the current constellation. */ 00063 float base_gain; 00064 /*! \brief Gain required to achieve the specified output power, allowing 00065 for the size of the current constellation. */ 00066 float gain; 00067 /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ 00068 float rrc_filter_re[V29_TX_FILTER_STEPS]; 00069 float rrc_filter_im[V29_TX_FILTER_STEPS]; 00070 #endif 00071 00072 /*! \brief Current offset into the RRC pulse shaping filter buffer. */ 00073 int rrc_filter_step; 00074 00075 /*! \brief The register for the data scrambler. */ 00076 uint32_t scramble_reg; 00077 /*! \brief The register for the training scrambler. */ 00078 uint8_t training_scramble_reg; 00079 /*! \brief TRUE if transmitting the training sequence, or shutting down transmission. 00080 FALSE if transmitting user data. */ 00081 int in_training; 00082 /*! \brief A counter used to track progress through sending the training sequence. */ 00083 int training_step; 00084 /*! \brief An offset value into the table of training parameters, used to match the 00085 training pattern to the bit rate. */ 00086 int training_offset; 00087 00088 /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ 00089 uint32_t carrier_phase; 00090 /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ 00091 int32_t carrier_phase_rate; 00092 /*! \brief The current fractional phase of the baud timing. */ 00093 int baud_phase; 00094 /*! \brief The code number for the current position in the constellation. */ 00095 int constellation_state; 00096 /*! \brief The get_bit function in use at any instant. */ 00097 get_bit_func_t current_get_bit; 00098 /*! \brief Error and flow logging control */ 00099 logging_state_t logging; 00100 }; 00101 00102 #endif 00103 /*- End of file ------------------------------------------------------------*/
1.6.1