Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e58b2e7d
提交
e58b2e7d
authored
7月 21, 2012
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some modem cleanups, and movement towards efficient fixed point modem
implementations for platforms with slow floating point
上级
5922cb59
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
459 行增加
和
368 行删除
+459
-368
v22bis.h
libs/spandsp/src/spandsp/private/v22bis.h
+14
-14
v27ter_rx.h
libs/spandsp/src/spandsp/private/v27ter_rx.h
+7
-7
v29rx.h
libs/spandsp/src/spandsp/private/v29rx.h
+1
-1
v27ter_rx.h
libs/spandsp/src/spandsp/v27ter_rx.h
+1
-1
v29rx.h
libs/spandsp/src/spandsp/v29rx.h
+1
-1
v17tx.c
libs/spandsp/src/v17tx.c
+13
-6
v22bis_rx.c
libs/spandsp/src/v22bis_rx.c
+233
-114
v22bis_tx.c
libs/spandsp/src/v22bis_tx.c
+9
-9
v27ter_rx.c
libs/spandsp/src/v27ter_rx.c
+107
-125
v29rx.c
libs/spandsp/src/v29rx.c
+73
-90
没有找到文件。
libs/spandsp/src/spandsp/private/v22bis.h
浏览文件 @
e58b2e7d
...
...
@@ -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
1
7
/*!
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
...
...
@@ -139,24 +139,24 @@ struct v22bis_state_s
#if defined(SPANDSP_USE_FIXED_POINTx)
/*! \brief The scaling factor accessed by the AGC algorithm. */
floa
t
agc_scaling
;
int16_
t
agc_scaling
;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
int16_t
rrc_filter
[
V22BIS_RX_FILTER_STEPS
];
/*! \brief The current delta factor for updating the equalizer coefficients. */
floa
t
eq_delta
;
int16_
t
eq_delta
;
/*! \brief The adaptive equalizer coefficients. */
complexi
_t
eq_coeff
[
2
*
V22BIS_EQUALIZER_LEN
+
1
];
complexi
16_t
eq_coeff
[
V22BIS_EQUALIZER_LEN
];
/*! \brief The equalizer signal buffer. */
complexi
_t
eq_buf
[
V22BIS_EQUALIZER_MASK
+
1
];
complexi
16_t
eq_buf
[
V22BIS_EQUALIZER_LEN
];
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
floa
t
training_error
;
int32_
t
training_error
;
/*! \brief The proportional part of the carrier tracking filter. */
floa
t
carrier_track_p
;
int32_
t
carrier_track_p
;
/*! \brief The integral part of the carrier tracking filter. */
floa
t
carrier_track_i
;
int32_
t
carrier_track_i
;
#else
/*! \brief The scaling factor accessed by the AGC algorithm. */
float
agc_scaling
;
...
...
@@ -166,9 +166,9 @@ struct v22bis_state_s
/*! \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
];
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
...
...
@@ -202,7 +202,7 @@ struct v22bis_state_s
/* Transmit section */
struct
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
/*! \brief The guard tone level. */
int16_t
guard_tone_gain
;
/*! \brief The gain factor needed to achieve the specified output power. */
...
...
libs/spandsp/src/spandsp/private/v27ter_rx.h
浏览文件 @
e58b2e7d
...
...
@@ -76,22 +76,22 @@ struct v27ter_rx_state_s
int16_t
agc_scaling_save
;
/*! \brief The current delta factor for updating the equalizer coefficients. */
floa
t
eq_delta
;
int16_
t
eq_delta
;
/*! \brief The adaptive equalizer coefficients. */
/*complexi16_t*/
complexf_t
eq_coeff
[
V27TER_EQUALIZER_LEN
];
complexi16_t
eq_coeff
[
V27TER_EQUALIZER_LEN
];
/*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */
/*complexi16_t*/
complexf_t
eq_coeff_save
[
V27TER_EQUALIZER_LEN
];
complexi16_t
eq_coeff_save
[
V27TER_EQUALIZER_LEN
];
/*! \brief The equalizer signal buffer. */
/*complexi16_t*/
complexf
_t
eq_buf
[
V27TER_EQUALIZER_LEN
];
complexi16
_t
eq_buf
[
V27TER_EQUALIZER_LEN
];
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
floa
t
training_error
;
int32_
t
training_error
;
/*! \brief The proportional part of the carrier tracking filter. */
floa
t
carrier_track_p
;
int32_
t
carrier_track_p
;
/*! \brief The integral part of the carrier tracking filter. */
floa
t
carrier_track_i
;
int32_
t
carrier_track_i
;
/*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */
int16_t
rrc_filter
[
V27TER_RX_FILTER_STEPS
];
#else
...
...
libs/spandsp/src/spandsp/private/v29rx.h
浏览文件 @
e58b2e7d
...
...
@@ -87,7 +87,7 @@ struct v29_rx_state_s
/*! \brief A measure of how much mismatch there is between the real constellation,
and the decoded symbol positions. */
floa
t
training_error
;
int32_
t
training_error
;
/*! \brief The proportional part of the carrier tracking filter. */
int32_t
carrier_track_p
;
...
...
libs/spandsp/src/spandsp/v27ter_rx.h
浏览文件 @
e58b2e7d
...
...
@@ -126,7 +126,7 @@ SPAN_DECLARE_NONSTD(int) v27ter_rx_fillin(v27ter_rx_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
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
SPAN_DECLARE
(
int
)
v27ter_rx_equalizer_state
(
v27ter_rx_state_t
*
s
,
complexi16_t
**
coeffs
);
#else
SPAN_DECLARE
(
int
)
v27ter_rx_equalizer_state
(
v27ter_rx_state_t
*
s
,
complexf_t
**
coeffs
);
...
...
libs/spandsp/src/spandsp/v29rx.h
浏览文件 @
e58b2e7d
...
...
@@ -118,7 +118,7 @@ scrambler register) cannot be trusted for the test. The receive modem,
therefore, only tests that bits starting at bit 24 are really ones.
*/
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
typedef
void
(
*
qam_report_handler_t
)(
void
*
user_data
,
const
complexi16_t
*
constel
,
const
complexi16_t
*
target
,
int
symbol
);
#else
typedef
void
(
*
qam_report_handler_t
)(
void
*
user_data
,
const
complexf_t
*
constel
,
const
complexf_t
*
target
,
int
symbol
);
...
...
libs/spandsp/src/v17tx.c
浏览文件 @
e58b2e7d
...
...
@@ -53,13 +53,19 @@
#include "spandsp/dds.h"
#include "spandsp/power_meter.h"
#if defined(SPANDSP_USE_FIXED_POINT)
#define SPANDSP_USE_FIXED_POINTx
#endif
#include "spandsp/v17tx.h"
#include "spandsp/private/logging.h"
#include "spandsp/private/v17tx.h"
#if defined(SPANDSP_USE_FIXED_POINT)
#define SPANDSP_USE_FIXED_POINTx
#define FP_SCALE(x) ((int16_t) x)
#else
#define FP_SCALE(x) (x)
#endif
#include "v17_v32bis_tx_constellation_maps.h"
...
...
@@ -229,6 +235,11 @@ static __inline__ complexf_t getbaud(v17_tx_state_t *s)
int
i
;
int
bit
;
int
bits
;
#if defined(SPANDSP_USE_FIXED_POINT)
static
const
complexi16_t
zero
=
{
0
,
0
};
#else
static
const
complexf_t
zero
=
{
0
.
0
f
,
0
.
0
f
};
#endif
if
(
s
->
in_training
)
{
...
...
@@ -251,11 +262,7 @@ static __inline__ complexf_t getbaud(v17_tx_state_t *s)
{
/* The shutdown sequence is 32 bauds of all 1's, then 48 bauds
of silence */
#if defined(SPANDSP_USE_FIXED_POINT)
return
complex_seti16
(
0
,
0
);
#else
return
complex_setf
(
0
.
0
f
,
0
.
0
f
);
#endif
return
zero
;
}
if
(
s
->
training_step
==
V17_TRAINING_SHUTDOWN_END
)
{
...
...
libs/spandsp/src/v22bis_rx.c
浏览文件 @
e58b2e7d
差异被折叠。
点击展开。
libs/spandsp/src/v22bis_tx.c
浏览文件 @
e58b2e7d
...
...
@@ -62,7 +62,7 @@
#include "spandsp/private/logging.h"
#include "spandsp/private/v22bis.h"
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
#define FP_SCALE FP_Q_6_10
#include "v22bis_tx_fixed_rrc.h"
#else
...
...
@@ -248,7 +248,7 @@ static const int phase_steps[4] =
1
,
0
,
2
,
3
};
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
const
complexi16_t
v22bis_constellation
[
16
]
=
#else
const
complexf_t
v22bis_constellation
[
16
]
=
...
...
@@ -314,7 +314,7 @@ static __inline__ int get_scrambled_bit(v22bis_state_t *s)
}
/*- End of function --------------------------------------------------------*/
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
static
complexi16_t
training_get
(
v22bis_state_t
*
s
)
#else
static
complexf_t
training_get
(
v22bis_state_t
*
s
)
...
...
@@ -417,13 +417,13 @@ static complexf_t training_get(v22bis_state_t *s)
}
/*- End of function --------------------------------------------------------*/
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
static
complexi16_t
getbaud
(
v22bis_state_t
*
s
)
#else
static
complexf_t
getbaud
(
v22bis_state_t
*
s
)
#endif
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
static
const
complexi16_t
zero
=
{
0
,
0
};
#else
static
const
complexf_t
zero
=
{
0
.
0
f
,
0
.
0
f
};
...
...
@@ -464,7 +464,7 @@ static complexf_t getbaud(v22bis_state_t *s)
SPAN_DECLARE_NONSTD
(
int
)
v22bis_tx
(
v22bis_state_t
*
s
,
int16_t
amp
[],
int
len
)
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t
v
;
complexi32_t
x
;
complexi32_t
z
;
...
...
@@ -490,7 +490,7 @@ SPAN_DECLARE_NONSTD(int) v22bis_tx(v22bis_state_t *s, int16_t amp[], int len)
if
(
++
s
->
tx
.
rrc_filter_step
>=
V22BIS_TX_FILTER_STEPS
)
s
->
tx
.
rrc_filter_step
=
0
;
}
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
/* Root raised cosine pulse shaping at baseband */
x
.
re
=
vec_circular_dot_prodi16
(
s
->
tx
.
rrc_filter_re
,
tx_pulseshaper
[
TX_PULSESHAPER_COEFF_SETS
-
1
-
s
->
tx
.
baud_phase
],
V22BIS_TX_FILTER_STEPS
,
s
->
tx
.
rrc_filter_step
)
>>
14
;
x
.
im
=
vec_circular_dot_prodi16
(
s
->
tx
.
rrc_filter_im
,
tx_pulseshaper
[
TX_PULSESHAPER_COEFF_SETS
-
1
-
s
->
tx
.
baud_phase
],
V22BIS_TX_FILTER_STEPS
,
s
->
tx
.
rrc_filter_step
)
>>
14
;
...
...
@@ -551,7 +551,7 @@ SPAN_DECLARE(void) v22bis_tx_power(v22bis_state_t *s, float power)
}
sig_gain
=
0
.
4490
f
*
powf
(
10
.
0
f
,
(
sig_power
-
DBM0_MAX_POWER
)
/
20
.
0
f
)
*
32768
.
0
f
/
TX_PULSESHAPER_GAIN
;
guard_tone_gain
=
powf
(
10
.
0
f
,
(
guard_tone_power
-
DBM0_MAX_POWER
)
/
20
.
0
f
)
*
32768
.
0
f
;
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
s
->
tx
.
gain
=
(
int16_t
)
sig_gain
;
s
->
tx
.
guard_tone_gain
=
(
int16_t
)
guard_tone_gain
;
#else
...
...
@@ -563,7 +563,7 @@ SPAN_DECLARE(void) v22bis_tx_power(v22bis_state_t *s, float power)
static
int
v22bis_tx_restart
(
v22bis_state_t
*
s
)
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
vec_zeroi16
(
s
->
tx
.
rrc_filter_re
,
sizeof
(
s
->
tx
.
rrc_filter_re
)
/
sizeof
(
s
->
tx
.
rrc_filter_re
[
0
]));
vec_zeroi16
(
s
->
tx
.
rrc_filter_im
,
sizeof
(
s
->
tx
.
rrc_filter_im
)
/
sizeof
(
s
->
tx
.
rrc_filter_im
[
0
]));
#else
...
...
libs/spandsp/src/v27ter_rx.c
浏览文件 @
e58b2e7d
差异被折叠。
点击展开。
libs/spandsp/src/v29rx.c
浏览文件 @
e58b2e7d
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论