~ubuntu-branches/ubuntu/intrepid/iaxmodem/intrepid

« back to all changes in this revision

Viewing changes to lib/spandsp/src/spandsp/v29rx.h

  • Committer: Bazaar Package Importer
  • Author(s): Julien BLACHE
  • Date: 2008-02-12 15:29:42 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080212152942-28cxxstfy8iujm0p
Tags: 1.1.0~dfsg-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 * along with this program; if not, write to the Free Software
23
23
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
24
 *
25
 
 * $Id: v29rx.h,v 1.45 2007/04/10 16:12:20 steveu Exp $
 
25
 * $Id: v29rx.h,v 1.51 2007/12/13 11:31:33 steveu Exp $
26
26
 */
27
27
 
28
28
/*! \file */
150
150
    void *qam_user_data;
151
151
 
152
152
    /*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */
 
153
#if defined(SPANDSP_USE_FIXED_POINT)
 
154
    int16_t rrc_filter[2*V29_RX_FILTER_STEPS];
 
155
#else
153
156
    float rrc_filter[2*V29_RX_FILTER_STEPS];
 
157
#endif
154
158
    /*! \brief Current offset into the RRC pulse shaping filter buffer. */
155
159
    int rrc_filter_step;
156
160
 
160
164
    uint8_t training_scramble_reg;
161
165
    /*! \brief The section of the training data we are currently in. */
162
166
    int training_stage;
 
167
    /*! \brief The current step in the table of CD constellation positions. */
163
168
    int training_cd;
 
169
    /*! \brief A count of how far through the current training step we are. */
164
170
    int training_count;
 
171
    /*! \brief A measure of how much mismatch there is between the real constellation,
 
172
        and the decoded symbol positions. */
165
173
    float training_error;
166
174
    /*! \brief The value of the last signal sample, using the a simple HPF for signal power estimation. */
167
175
    int16_t last_sample;
169
177
    int signal_present;
170
178
    /*! \brief Whether or not a carrier drop was detected and the signal delivery is pending. */
171
179
    int carrier_drop_pending;
172
 
 
 
180
    /*! \brief A count of the current consecutive samples below the carrier off threshold. */
 
181
    int low_samples;
 
182
    /*! \brief A highest magnitude sample seen. */
 
183
    int16_t high_sample;
173
184
    /*! \brief TRUE if the previous trained values are to be reused. */
174
185
    int old_train;
175
186
 
179
190
    int32_t carrier_phase_rate;
180
191
    /*! \brief The carrier update rate saved for reuse when using short training. */
181
192
    int32_t carrier_phase_rate_save;
 
193
    /*! \brief The proportional part of the carrier tracking filter. */
182
194
    float carrier_track_p;
 
195
    /*! \brief The integral part of the carrier tracking filter. */
183
196
    float carrier_track_i;
184
 
    
 
197
 
 
198
    /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */    
185
199
    power_meter_t power;
 
200
    /*! \brief The power meter level at which carrier on is declared. */
186
201
    int32_t carrier_on_power;
 
202
    /*! \brief The power meter level at which carrier off is declared. */
187
203
    int32_t carrier_off_power;
 
204
    /*! \brief The scaling factor accessed by the AGC algorithm. */
188
205
    float agc_scaling;
 
206
    /*! \brief The previous value of agc_scaling, needed to reuse old training. */
189
207
    float agc_scaling_save;
190
208
 
191
209
    int constellation_state;
192
210
 
 
211
    /*! \brief The current delta factor for updating the equalizer coefficients. */
193
212
    float eq_delta;
194
 
    /*! \brief The adaptive equalizer coefficients */
 
213
#if defined(SPANDSP_USE_FIXED_POINTx)
 
214
    /*! \brief The adaptive equalizer coefficients. */
 
215
    complexi_t eq_coeff[V29_EQUALIZER_PRE_LEN + 1 + V29_EQUALIZER_POST_LEN];
 
216
    /*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */
 
217
    complexi_t eq_coeff_save[V29_EQUALIZER_PRE_LEN + 1 + V29_EQUALIZER_POST_LEN];
 
218
    /*! \brief The equalizer signal buffer. */
 
219
    complexi_t eq_buf[V29_EQUALIZER_MASK + 1];
 
220
#else
195
221
    complexf_t eq_coeff[V29_EQUALIZER_PRE_LEN + 1 + V29_EQUALIZER_POST_LEN];
196
222
    complexf_t eq_coeff_save[V29_EQUALIZER_PRE_LEN + 1 + V29_EQUALIZER_POST_LEN];
197
223
    complexf_t eq_buf[V29_EQUALIZER_MASK + 1];
198
 
    /*! \brief Current offset into equalizer buffer. */
 
224
#endif
 
225
    /*! \brief Current offset into the equalizer buffer. */
199
226
    int eq_step;
 
227
    /*! \brief Current write offset into the equalizer buffer. */
200
228
    int eq_put_step;
 
229
    /*! \brief Symbol counter to the next equalizer update. */
201
230
    int eq_skip;
202
231
 
203
232
    /*! \brief The current half of the baud. */
204
233
    int baud_half;
205
 
    /*! \brief Band edge symbol sync. filter state. */
 
234
#if defined(SPANDSP_USE_FIXED_POINTx)
 
235
    /*! Low band edge filter for symbol sync. */
 
236
    int32_t symbol_sync_low[2];
 
237
    /*! High band edge filter for symbol sync. */
 
238
    int32_t symbol_sync_high[2];
 
239
    /*! DC filter for symbol sync. */
 
240
    int32_t symbol_sync_dc_filter[2];
 
241
    /*! Baud phase for symbol sync. */
 
242
    int32_t baud_phase;
 
243
#else
 
244
    /*! Low band edge filter for symbol sync. */
206
245
    float symbol_sync_low[2];
 
246
    /*! High band edge filter for symbol sync. */
207
247
    float symbol_sync_high[2];
 
248
    /*! DC filter for symbol sync. */
208
249
    float symbol_sync_dc_filter[2];
 
250
    /*! Baud phase for symbol sync. */
209
251
    float baud_phase;
 
252
#endif
 
253
 
210
254
    /*! \brief The total symbol timing correction since the carrier came up.
211
255
               This is only for performance analysis purposes. */
212
256
    int total_baud_timing_correction;
219
263
    logging_state_t logging;
220
264
} v29_rx_state_t;
221
265
 
222
 
#ifdef __cplusplus
 
266
#if defined(__cplusplus)
223
267
extern "C"
224
268
{
225
269
#endif
241
285
    \return 0 for OK, -1 for bad parameter */
242
286
int v29_rx_restart(v29_rx_state_t *s, int rate, int old_train);
243
287
 
244
 
/*! Release a V.29 modem receive context.
245
 
    \brief Release a V.29 modem receive context.
 
288
/*! Free a V.29 modem receive context.
 
289
    \brief Free a V.29 modem receive context.
246
290
    \param s The modem context.
247
291
    \return 0 for OK */
248
 
int v29_rx_release(v29_rx_state_t *s);
 
292
int v29_rx_free(v29_rx_state_t *s);
249
293
 
250
294
/*! Change the put_bit function associated with a V.29 modem receive context.
251
295
    \brief Change the put_bit function associated with a V.29 modem receive context.
295
339
    \param user_data An opaque pointer passed to the handler routine. */
296
340
void v29_rx_set_qam_report_handler(v29_rx_state_t *s, qam_report_handler_t *handler, void *user_data);
297
341
 
298
 
#ifdef __cplusplus
 
342
#if defined(__cplusplus)
299
343
}
300
344
#endif
301
345