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