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