22
22
* along with this program; if not, write to the Free Software
23
23
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 $
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. */
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;
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;
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;
191
209
int constellation_state;
211
/*! \brief The current delta factor for updating the equalizer coefficients. */
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];
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. */
225
/*! \brief Current offset into the equalizer buffer. */
227
/*! \brief Current write offset into the equalizer buffer. */
229
/*! \brief Symbol counter to the next equalizer update. */
203
232
/*! \brief The current half of the baud. */
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. */
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;
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;
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);
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);
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.