提交 80d5c5aa authored 作者: Steve Underwood's avatar Steve Underwood

Some tweaks to the V.22bis modem, so it builds OK in a fixed point build

上级 cc08b939
......@@ -26,10 +26,10 @@
#if !defined(_SPANDSP_PRIVATE_V22BIS_H_)
#define _SPANDSP_PRIVATE_V22BIS_H_
/*! The number of steps to the left and to the right of the target position in the equalizer buffer. */
#define V22BIS_EQUALIZER_LEN 7
/*! One less than a power of 2 >= (2*V22BIS_EQUALIZER_LEN + 1) */
#define V22BIS_EQUALIZER_MASK 15
/*! The length of the equalizer buffer */
#define V22BIS_EQUALIZER_LEN 17
/*! Samples before the target position in the equalizer buffer */
#define V22BIS_EQUALIZER_PRE_LEN 8
/*! The number of taps in the transmit pulse shaping filter */
#define V22BIS_TX_FILTER_STEPS 9
......@@ -99,9 +99,9 @@ struct v22bis_state_s
/* Receive section */
struct
{
#if defined(SPANDSP_USE_FIXED_POINTx)
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The scaling factor accessed by the AGC algorithm. */
float agc_scaling;
int16_t agc_scaling;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
int16_t rrc_filter[V22BIS_RX_FILTER_STEPS];
#else
......@@ -131,15 +131,14 @@ struct v22bis_state_s
uint32_t carrier_phase;
/*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */
int32_t carrier_phase_rate;
#if defined(SPANDSP_USE_FIXED_POINTx)
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
float training_error;
int32_t training_error;
/*! \brief The proportional part of the carrier tracking filter. */
float carrier_track_p;
int32_t carrier_track_p;
/*! \brief The integral part of the carrier tracking filter. */
float carrier_track_i;
int32_t carrier_track_i;
#else
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
......@@ -166,20 +165,20 @@ struct v22bis_state_s
int constellation_state;
#if defined(SPANDSP_USE_FIXED_POINTx)
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The current delta factor for updating the equalizer coefficients. */
float eq_delta;
int16_t eq_delta;
/*! \brief The adaptive equalizer coefficients. */
complexi_t eq_coeff[2*V22BIS_EQUALIZER_LEN + 1];
complexi16_t eq_coeff[V22BIS_EQUALIZER_LEN];
/*! \brief The equalizer signal buffer. */
complexi_t eq_buf[V22BIS_EQUALIZER_MASK + 1];
complexi16_t eq_buf[V22BIS_EQUALIZER_LEN];
#else
/*! \brief The current delta factor for updating the equalizer coefficients. */
float eq_delta;
/*! \brief The adaptive equalizer coefficients. */
complexf_t eq_coeff[2*V22BIS_EQUALIZER_LEN + 1];
complexf_t eq_coeff[V22BIS_EQUALIZER_LEN];
/*! \brief The equalizer signal buffer. */
complexf_t eq_buf[V22BIS_EQUALIZER_MASK + 1];
complexf_t eq_buf[V22BIS_EQUALIZER_LEN];
#endif
/*! \brief Current offset into the equalizer buffer. */
int eq_step;
......@@ -205,20 +204,22 @@ struct v22bis_state_s
/* Transmit section */
struct
{
#if defined(SPANDSP_USE_FIXED_POINTx)
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The guard tone level. */
float guard_level;
int16_t guard_tone_gain;
/*! \brief The gain factor needed to achieve the specified output power. */
float gain;
int16_t gain;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
complexf_t rrc_filter[2*V22BIS_TX_FILTER_STEPS];
int16_t rrc_filter_re[V22BIS_TX_FILTER_STEPS];
int16_t rrc_filter_im[V22BIS_TX_FILTER_STEPS];
#else
/*! \brief The guard tone level. */
float guard_level;
float guard_tone_gain;
/*! \brief The gain factor needed to achieve the specified output power. */
float gain;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
complexf_t rrc_filter[2*V22BIS_TX_FILTER_STEPS];
float rrc_filter_re[V22BIS_TX_FILTER_STEPS];
float rrc_filter_im[V22BIS_TX_FILTER_STEPS];
#endif
/*! \brief Current offset into the RRC pulse shaping filter buffer. */
......
......@@ -86,7 +86,11 @@ SPAN_DECLARE_NONSTD(int) v22bis_rx_fillin(v22bis_state_t *s, int len);
\brief Get a snapshot of the current equalizer coefficients.
\param coeffs The vector of complex coefficients.
\return The number of coefficients in the vector. */
#if defined(SPANDSP_USE_FIXED_POINT)
SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexi16_t **coeffs);
#else
SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexf_t **coeffs);
#endif
/*! Get the current received carrier frequency.
\param s The modem context.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论