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 * $Id: v29tx.h,v 1.1 2008/10/13 13:14:01 steveu Exp $ 00026 */ 00027 00028 #if !defined(_SPANDSP_PRIVATE_V29TX_H_) 00029 #define _SPANDSP_PRIVATE_V29TX_H_ 00030 00031 /*! 00032 V.29 modem transmit side descriptor. This defines the working state for a 00033 single instance of a V.29 modem transmitter. 00034 */ 00035 struct v29_tx_state_s 00036 { 00037 /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */ 00038 int bit_rate; 00039 /*! \brief The callback function used to get the next bit to be transmitted. */ 00040 get_bit_func_t get_bit; 00041 /*! \brief A user specified opaque pointer passed to the get_bit function. */ 00042 void *get_bit_user_data; 00043 00044 /*! \brief The callback function used to report modem status changes. */ 00045 modem_tx_status_func_t status_handler; 00046 /*! \brief A user specified opaque pointer passed to the status function. */ 00047 void *status_user_data; 00048 00049 /*! \brief Gain required to achieve the specified output power, not allowing 00050 for the size of the current constellation. */ 00051 float base_gain; 00052 /*! \brief Gain required to achieve the specified output power, allowing 00053 for the size of the current constellation. */ 00054 #if defined(SPANDSP_USE_FIXED_POINT) 00055 int32_t gain; 00056 #else 00057 float gain; 00058 #endif 00059 00060 /*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */ 00061 #if defined(SPANDSP_USE_FIXED_POINT) 00062 complexi16_t rrc_filter[2*V29_TX_FILTER_STEPS]; 00063 #else 00064 complexf_t rrc_filter[2*V29_TX_FILTER_STEPS]; 00065 #endif 00066 /*! \brief Current offset into the RRC pulse shaping filter buffer. */ 00067 int rrc_filter_step; 00068 00069 /*! \brief The register for the data scrambler. */ 00070 unsigned int scramble_reg; 00071 /*! \brief The register for the training scrambler. */ 00072 uint8_t training_scramble_reg; 00073 /*! \brief TRUE if transmitting the training sequence, or shutting down transmission. 00074 FALSE if transmitting user data. */ 00075 int in_training; 00076 /*! \brief A counter used to track progress through sending the training sequence. */ 00077 int training_step; 00078 /*! \brief An offset value into the table of training parameters, used to match the 00079 training pattern to the bit rate. */ 00080 int training_offset; 00081 00082 /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ 00083 uint32_t carrier_phase; 00084 /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ 00085 int32_t carrier_phase_rate; 00086 /*! \brief The current fractional phase of the baud timing. */ 00087 int baud_phase; 00088 /*! \brief The code number for the current position in the constellation. */ 00089 int constellation_state; 00090 /*! \brief The get_bit function in use at any instant. */ 00091 get_bit_func_t current_get_bit; 00092 /*! \brief Error and flow logging control */ 00093 logging_state_t logging; 00094 }; 00095 00096 #endif 00097 /*- End of file ------------------------------------------------------------*/