Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/private/v17tx.h @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 15:50:58 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
---|---|
1 /* | |
2 * SpanDSP - a series of DSP components for telephony | |
3 * | |
4 * private/v17tx.h - ITU V.17 modem transmit part | |
5 * | |
6 * Written by Steve Underwood <steveu@coppice.org> | |
7 * | |
8 * Copyright (C) 2004 Steve Underwood | |
9 * | |
10 * All rights reserved. | |
11 * | |
12 * This program is free software; you can redistribute it and/or modify | |
13 * it under the terms of the GNU Lesser General Public License version 2.1, | |
14 * as published by the Free Software Foundation. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU Lesser General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU Lesser General Public | |
22 * License along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
24 * | |
25 * $Id: v17tx.h,v 1.2.4.1 2009/12/24 16:52:30 steveu Exp $ | |
26 */ | |
27 | |
28 /*! \file */ | |
29 | |
30 #if !defined(_SPANDSP_PRIVATE_V17TX_H_) | |
31 #define _SPANDSP_PRIVATE_V17TX_H_ | |
32 | |
33 /*! The number of taps in the pulse shaping/bandpass filter */ | |
34 #define V17_TX_FILTER_STEPS 9 | |
35 | |
36 /*! | |
37 V.17 modem transmit side descriptor. This defines the working state for a | |
38 single instance of a V.17 modem transmitter. | |
39 */ | |
40 struct v17_tx_state_s | |
41 { | |
42 /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */ | |
43 int bit_rate; | |
44 /*! \brief The callback function used to get the next bit to be transmitted. */ | |
45 get_bit_func_t get_bit; | |
46 /*! \brief A user specified opaque pointer passed to the get_bit function. */ | |
47 void *get_bit_user_data; | |
48 | |
49 /*! \brief The callback function used to report modem status changes. */ | |
50 modem_tx_status_func_t status_handler; | |
51 /*! \brief A user specified opaque pointer passed to the status function. */ | |
52 void *status_user_data; | |
53 | |
54 /*! \brief The gain factor needed to achieve the specified output power. */ | |
55 #if defined(SPANDSP_USE_FIXED_POINT) | |
56 int32_t gain; | |
57 #else | |
58 float gain; | |
59 #endif | |
60 | |
61 /*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */ | |
62 #if defined(SPANDSP_USE_FIXED_POINT) | |
63 complexi16_t rrc_filter[2*V17_TX_FILTER_STEPS]; | |
64 #else | |
65 complexf_t rrc_filter[2*V17_TX_FILTER_STEPS]; | |
66 #endif | |
67 /*! \brief Current offset into the RRC pulse shaping filter buffer. */ | |
68 int rrc_filter_step; | |
69 | |
70 /*! \brief The current state of the differential encoder. */ | |
71 int diff; | |
72 /*! \brief The current state of the convolutional encoder. */ | |
73 int convolution; | |
74 /*! \brief The code number for the current position in the constellation. */ | |
75 int constellation_state; | |
76 | |
77 /*! \brief The register for the data scrambler. */ | |
78 uint32_t scramble_reg; | |
79 /*! \brief Scrambler tap */ | |
80 //int scrambler_tap; | |
81 /*! \brief TRUE if transmitting the training sequence. FALSE if transmitting user data. */ | |
82 int in_training; | |
83 /*! \brief TRUE if the short training sequence is to be used. */ | |
84 int short_train; | |
85 /*! \brief A counter used to track progress through sending the training sequence. */ | |
86 int training_step; | |
87 | |
88 /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ | |
89 uint32_t carrier_phase; | |
90 /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ | |
91 int32_t carrier_phase_rate; | |
92 /*! \brief The current fractional phase of the baud timing. */ | |
93 int baud_phase; | |
94 | |
95 /*! \brief A pointer to the constellation currently in use. */ | |
96 #if defined(SPANDSP_USE_FIXED_POINT) | |
97 const complexi16_t *constellation; | |
98 #else | |
99 const complexf_t *constellation; | |
100 #endif | |
101 /*! \brief The current number of data bits per symbol. This does not include | |
102 the redundant bit. */ | |
103 int bits_per_symbol; | |
104 /*! \brief The get_bit function in use at any instant. */ | |
105 get_bit_func_t current_get_bit; | |
106 /*! \brief Error and flow logging control */ | |
107 logging_state_t logging; | |
108 }; | |
109 | |
110 #endif | |
111 /*- End of file ------------------------------------------------------------*/ |