spandsp 0.0.6
|
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_tx_status_func_t status_handler; 00049 /*! \brief A user specified opaque pointer passed to the status function. */ 00050 void *status_user_data; 00051 00052 /*! \brief The gain factor needed to achieve the specified output power. */ 00053 #if defined(SPANDSP_USE_FIXED_POINT) 00054 int32_t gain; 00055 #else 00056 float gain; 00057 #endif 00058 00059 /*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */ 00060 #if defined(SPANDSP_USE_FIXED_POINT) 00061 complexi16_t rrc_filter[2*V17_TX_FILTER_STEPS]; 00062 #else 00063 complexf_t rrc_filter[2*V17_TX_FILTER_STEPS]; 00064 #endif 00065 /*! \brief Current offset into the RRC pulse shaping filter buffer. */ 00066 int rrc_filter_step; 00067 00068 /*! \brief The current state of the differential encoder. */ 00069 int diff; 00070 /*! \brief The current state of the convolutional encoder. */ 00071 int convolution; 00072 /*! \brief The code number for the current position in the constellation. */ 00073 int constellation_state; 00074 00075 /*! \brief The register for the data scrambler. */ 00076 uint32_t scramble_reg; 00077 /*! \brief Scrambler tap */ 00078 //int scrambler_tap; 00079 /*! \brief TRUE if transmitting the training sequence. FALSE if transmitting user data. */ 00080 int in_training; 00081 /*! \brief TRUE if the short training sequence is to be used. */ 00082 int short_train; 00083 /*! \brief A counter used to track progress through sending the training sequence. */ 00084 int training_step; 00085 00086 /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ 00087 uint32_t carrier_phase; 00088 /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ 00089 int32_t carrier_phase_rate; 00090 /*! \brief The current fractional phase of the baud timing. */ 00091 int baud_phase; 00092 00093 /*! \brief A pointer to the constellation currently in use. */ 00094 #if defined(SPANDSP_USE_FIXED_POINT) 00095 const complexi16_t *constellation; 00096 #else 00097 const complexf_t *constellation; 00098 #endif 00099 /*! \brief The current number of data bits per symbol. This does not include 00100 the redundant bit. */ 00101 int bits_per_symbol; 00102 /*! \brief The get_bit function in use at any instant. */ 00103 get_bit_func_t current_get_bit; 00104 /*! \brief Error and flow logging control */ 00105 logging_state_t logging; 00106 }; 00107 00108 #endif 00109 /*- End of file ------------------------------------------------------------*/