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