00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * private/v17tx.h - ITU V.17 modem transmit part 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2004 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: v17tx.h,v 1.1 2008/10/13 13:14:01 steveu Exp $ 00026 */ 00027 00028 /*! \file */ 00029 00030 #if !defined(_SPANDSP_PRIVATE_V17TX_H_) 00031 #define _SPANDSP_PRIVATE_V17TX_H_ 00032 00033 /*! 00034 V.17 modem transmit side descriptor. This defines the working state for a 00035 single instance of a V.17 modem transmitter. 00036 */ 00037 struct v17_tx_state_s 00038 { 00039 /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */ 00040 int bit_rate; 00041 /*! \brief The callback function used to get the next bit to be transmitted. */ 00042 get_bit_func_t get_bit; 00043 /*! \brief A user specified opaque pointer passed to the get_bit function. */ 00044 void *get_bit_user_data; 00045 00046 /*! \brief The callback function used to report modem status changes. */ 00047 modem_tx_status_func_t status_handler; 00048 /*! \brief A user specified opaque pointer passed to the status function. */ 00049 void *status_user_data; 00050 00051 /*! \brief The gain factor needed to achieve the specified output power. */ 00052 #if defined(SPANDSP_USE_FIXED_POINT) 00053 int32_t gain; 00054 #else 00055 float gain; 00056 #endif 00057 00058 /*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */ 00059 #if defined(SPANDSP_USE_FIXED_POINT) 00060 complexi16_t rrc_filter[2*V17_TX_FILTER_STEPS]; 00061 #else 00062 complexf_t rrc_filter[2*V17_TX_FILTER_STEPS]; 00063 #endif 00064 /*! \brief Current offset into the RRC pulse shaping filter buffer. */ 00065 int rrc_filter_step; 00066 00067 /*! \brief The current state of the differential encoder. */ 00068 int diff; 00069 /*! \brief The current state of the convolutional encoder. */ 00070 int convolution; 00071 00072 /*! \brief The register for the data scrambler. */ 00073 unsigned int scramble_reg; 00074 /*! \brief TRUE if transmitting the training sequence. FALSE if transmitting user data. */ 00075 int in_training; 00076 /*! \brief TRUE if the short training sequence is to be used. */ 00077 int short_train; 00078 /*! \brief A counter used to track progress through sending the training sequence. */ 00079 int training_step; 00080 00081 /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ 00082 uint32_t carrier_phase; 00083 /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ 00084 int32_t carrier_phase_rate; 00085 /*! \brief The current fractional phase of the baud timing. */ 00086 int baud_phase; 00087 /*! \brief The code number for the current position in the constellation. */ 00088 int constellation_state; 00089 00090 /*! \brief A pointer to the constellation currently in use. */ 00091 #if defined(SPANDSP_USE_FIXED_POINT) 00092 const complexi16_t *constellation; 00093 #else 00094 const complexf_t *constellation; 00095 #endif 00096 /*! \brief The current number of data bits per symbol. This does not include 00097 the redundant bit. */ 00098 int bits_per_symbol; 00099 /*! \brief The get_bit function in use at any instant. */ 00100 get_bit_func_t current_get_bit; 00101 /*! \brief Error and flow logging control */ 00102 logging_state_t logging; 00103 }; 00104 00105 #endif 00106 /*- End of file ------------------------------------------------------------*/