private/v17tx.h
Go to the documentation of this file.
/*
* SpanDSP - a series of DSP components for telephony
*
* private/v17tx.h - ITU V.17 modem transmit part
*
* Written by Steve Underwood <steveu@coppice.org>
*
* Copyright (C) 2004 Steve Underwood
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*! \file */
#if !defined(_SPANDSP_PRIVATE_V17TX_H_)
#define _SPANDSP_PRIVATE_V17TX_H_
/*! The number of taps in the pulse shaping/bandpass filter */
#define V17_TX_FILTER_STEPS 9
/*!
V.17 modem transmit side descriptor. This defines the working state for a
single instance of a V.17 modem transmitter.
*/
struct v17_tx_state_s
{
/*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */
int bit_rate;
/*! \brief The callback function used to get the next bit to be transmitted. */
get_bit_func_t get_bit;
/*! \brief A user specified opaque pointer passed to the get_bit function. */
void *get_bit_user_data;
/*! \brief The callback function used to report modem status changes. */
modem_status_func_t status_handler;
/*! \brief A user specified opaque pointer passed to the status function. */
void *status_user_data;
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The gain factor needed to achieve the specified output power. */
int32_t gain;
/*! \brief A pointer to the constellation currently in use. */
const complexi16_t *constellation;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
complexi16_t rrc_filter[2*V17_TX_FILTER_STEPS];
#else
/*! \brief The gain factor needed to achieve the specified output power. */
float gain;
/*! \brief A pointer to the constellation currently in use. */
const complexf_t *constellation;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
complexf_t rrc_filter[2*V17_TX_FILTER_STEPS];
#endif
/*! \brief Current offset into the RRC pulse shaping filter buffer. */
int rrc_filter_step;
/*! \brief The current state of the differential encoder. */
int diff;
/*! \brief The current state of the convolutional encoder. */
int convolution;
/*! \brief The code number for the current position in the constellation. */
int constellation_state;
/*! \brief The register for the data scrambler. */
uint32_t scramble_reg;
/*! \brief Scrambler tap */
//int scrambler_tap;
/*! \brief TRUE if transmitting the training sequence. FALSE if transmitting user data. */
int in_training;
/*! \brief TRUE if the short training sequence is to be used. */
int short_train;
/*! \brief A counter used to track progress through sending the training sequence. */
int training_step;
/*! \brief The current phase of the carrier (i.e. the DDS parameter). */
uint32_t carrier_phase;
/*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */
int32_t carrier_phase_rate;
/*! \brief The current fractional phase of the baud timing. */
int baud_phase;
/*! \brief The current number of data bits per symbol. This does not include
the redundant bit. */
int bits_per_symbol;
/*! \brief The get_bit function in use at any instant. */
get_bit_func_t current_get_bit;
/*! \brief Error and flow logging control */
logging_state_t logging;
};
#endif
/*- End of file ------------------------------------------------------------*/
modem_status_func_t
void(* modem_status_func_t)(void *user_data, int status)
Definition async.h:114
get_bit_func_t
int(* get_bit_func_t)(void *user_data)
Definition async.h:108
logging_state_t
struct logging_state_s logging_state_t
Definition logging.h:75
V17_TX_FILTER_STEPS
#define V17_TX_FILTER_STEPS
Definition private/v17tx.h:32
complexf_t
Definition complex.h:43
complexi16_t
Definition complex.h:89
v17_tx_state_s
Definition private/v17tx.h:39
v17_tx_state_s::get_bit_user_data
void * get_bit_user_data
A user specified opaque pointer passed to the get_bit function.
Definition private/v17tx.h:45
v17_tx_state_s::in_training
int in_training
Scrambler tap.
Definition private/v17tx.h:83
v17_tx_state_s::carrier_phase_rate
int32_t carrier_phase_rate
The update rate for the phase of the carrier (i.e. the DDS increment).
Definition private/v17tx.h:92
v17_tx_state_s::short_train
int short_train
TRUE if the short training sequence is to be used.
Definition private/v17tx.h:85
v17_tx_state_s::rrc_filter_step
int rrc_filter_step
Current offset into the RRC pulse shaping filter buffer.
Definition private/v17tx.h:69
v17_tx_state_s::scramble_reg
uint32_t scramble_reg
The register for the data scrambler.
Definition private/v17tx.h:79
v17_tx_state_s::convolution
int convolution
The current state of the convolutional encoder.
Definition private/v17tx.h:74
v17_tx_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition private/v17tx.h:102
v17_tx_state_s::training_step
int training_step
A counter used to track progress through sending the training sequence.
Definition private/v17tx.h:87
v17_tx_state_s::status_user_data
void * status_user_data
A user specified opaque pointer passed to the status function.
Definition private/v17tx.h:50
v17_tx_state_s::carrier_phase
uint32_t carrier_phase
The current phase of the carrier (i.e. the DDS parameter).
Definition private/v17tx.h:90
v17_tx_state_s::status_handler
modem_status_func_t status_handler
The callback function used to report modem status changes.
Definition private/v17tx.h:48
v17_tx_state_s::diff
int diff
The current state of the differential encoder.
Definition private/v17tx.h:72
v17_tx_state_s::constellation
const complexf_t * constellation
A pointer to the constellation currently in use.
Definition private/v17tx.h:63
v17_tx_state_s::bit_rate
int bit_rate
The bit rate of the modem. Valid values are 4800, 7200 and 9600.
Definition private/v17tx.h:41
v17_tx_state_s::bits_per_symbol
int bits_per_symbol
The current number of data bits per symbol. This does not include the redundant bit.
Definition private/v17tx.h:98
v17_tx_state_s::current_get_bit
get_bit_func_t current_get_bit
The get_bit function in use at any instant.
Definition private/v17tx.h:100
v17_tx_state_s::get_bit
get_bit_func_t get_bit
The callback function used to get the next bit to be transmitted.
Definition private/v17tx.h:43
v17_tx_state_s::baud_phase
int baud_phase
The current fractional phase of the baud timing.
Definition private/v17tx.h:94
v17_tx_state_s::constellation_state
int constellation_state
The code number for the current position in the constellation.
Definition private/v17tx.h:76
v17_tx_state_s::rrc_filter
complexf_t rrc_filter[2 *9]
The root raised cosine (RRC) pulse shaping filter buffer.
Definition private/v17tx.h:65
v17_tx_state_s::gain
float gain
The gain factor needed to achieve the specified output power.
Definition private/v17tx.h:61