Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
fd8c576c
提交
fd8c576c
authored
7月 21, 2012
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some tidying of the V.17 modem. Brought the modem test programs up to date
上级
e58b2e7d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
391 行增加
和
145 行删除
+391
-145
v17rx.h
libs/spandsp/src/spandsp/private/v17rx.h
+6
-6
v17rx.h
libs/spandsp/src/spandsp/v17rx.h
+1
-1
v17rx.c
libs/spandsp/src/v17rx.c
+277
-89
v27ter_tx.c
libs/spandsp/src/v27ter_tx.c
+13
-21
fax_tests.c
libs/spandsp/tests/fax_tests.c
+14
-2
v17_tests.c
libs/spandsp/tests/v17_tests.c
+30
-9
v22bis_tests.c
libs/spandsp/tests/v22bis_tests.c
+19
-6
v27ter_tests.c
libs/spandsp/tests/v27ter_tests.c
+28
-8
v29_tests.c
libs/spandsp/tests/v29_tests.c
+3
-3
没有找到文件。
libs/spandsp/src/spandsp/private/v17rx.h
浏览文件 @
fd8c576c
...
...
@@ -74,12 +74,12 @@ struct v17_rx_state_s
#if defined(SPANDSP_USE_FIXED_POINTx)
/*! \brief The scaling factor assessed by the AGC algorithm. */
floa
t
agc_scaling
;
int16_
t
agc_scaling
;
/*! \brief The previous value of agc_scaling, needed to reuse old training. */
floa
t
agc_scaling_save
;
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
eq_coeff
[
V17_EQUALIZER_LEN
];
/*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */
...
...
@@ -98,12 +98,12 @@ struct v17_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. */
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
[
V17_RX_FILTER_STEPS
];
...
...
libs/spandsp/src/spandsp/v17rx.h
浏览文件 @
fd8c576c
...
...
@@ -292,7 +292,7 @@ SPAN_DECLARE_NONSTD(int) v17_rx_fillin(v17_rx_state_t *s, int len);
\param s The modem context.
\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
)
v17_rx_equalizer_state
(
v17_rx_state_t
*
s
,
complexi16_t
**
coeffs
);
#else
SPAN_DECLARE
(
int
)
v17_rx_equalizer_state
(
v17_rx_state_t
*
s
,
complexf_t
**
coeffs
);
...
...
libs/spandsp/src/v17rx.c
浏览文件 @
fd8c576c
差异被折叠。
点击展开。
libs/spandsp/src/v27ter_tx.c
浏览文件 @
fd8c576c
...
...
@@ -59,9 +59,11 @@
#include "spandsp/private/v27ter_tx.h"
#if defined(SPANDSP_USE_FIXED_POINT)
#define FP_SCALE FP_Q_6_10
#include "v27ter_tx_4800_fixed_rrc.h"
#include "v27ter_tx_2400_fixed_rrc.h"
#else
#define FP_SCALE(x) (x)
#include "v27ter_tx_4800_floating_rrc.h"
#include "v27ter_tx_2400_floating_rrc.h"
#endif
...
...
@@ -149,32 +151,22 @@ static complexf_t getbaud(v27ter_tx_state_t *s)
0
,
2
,
6
,
4
};
#if defined(SPANDSP_USE_FIXED_POINT)
static
const
complexi16_t
constellation
[
8
]
=
{
{
FP_Q_6_10
(
1
.
414
f
),
FP_Q_6_10
(
0
.
0
f
)},
/* 0deg */
{
FP_Q_6_10
(
1
.
0
f
),
FP_Q_6_10
(
1
.
0
f
)},
/* 45deg */
{
FP_Q_6_10
(
0
.
0
f
),
FP_Q_6_10
(
1
.
414
f
)},
/* 90deg */
{
FP_Q_6_10
(
-
1
.
0
f
),
FP_Q_6_10
(
1
.
0
f
)},
/* 135deg */
{
FP_Q_6_10
(
-
1
.
414
f
),
FP_Q_6_10
(
0
.
0
f
)},
/* 180deg */
{
FP_Q_6_10
(
-
1
.
0
f
),
FP_Q_6_10
(
-
1
.
0
f
)},
/* 225deg */
{
FP_Q_6_10
(
0
.
0
f
),
FP_Q_6_10
(
-
1
.
414
f
)},
/* 270deg */
{
FP_Q_6_10
(
1
.
0
f
),
FP_Q_6_10
(
-
1
.
0
f
)}
/* 315deg */
};
static
const
complexi16_t
zero
=
{
0
,
0
};
static
const
complexi16_t
constellation
[
8
]
=
#else
static
const
complexf_t
zero
=
{
0
.
0
f
,
0
.
0
f
};
static
const
complexf_t
constellation
[
8
]
=
#endif
{
{
1
.
414
f
,
0
.
0
f
},
/* 0deg */
{
1
.
0
f
,
1
.
0
f
},
/* 45deg */
{
0
.
0
f
,
1
.
414
f
},
/* 90deg */
{
-
1
.
0
f
,
1
.
0
f
},
/* 135deg */
{
-
1
.
414
f
,
0
.
0
f
},
/* 180deg */
{
-
1
.
0
f
,
-
1
.
0
f
},
/* 225deg */
{
0
.
0
f
,
-
1
.
414
f
},
/* 270deg */
{
1
.
0
f
,
-
1
.
0
f
}
/* 315deg */
{
FP_SCALE
(
1
.
414
f
),
FP_SCALE
(
0
.
0
f
)
},
/* 0deg */
{
FP_SCALE
(
1
.
0
f
),
FP_SCALE
(
1
.
0
f
)
},
/* 45deg */
{
FP_SCALE
(
0
.
0
f
),
FP_SCALE
(
1
.
414
f
)
},
/* 90deg */
{
FP_SCALE
(
-
1
.
0
f
),
FP_SCALE
(
1
.
0
f
)
},
/* 135deg */
{
FP_SCALE
(
-
1
.
414
f
),
FP_SCALE
(
0
.
0
f
)
},
/* 180deg */
{
FP_SCALE
(
-
1
.
0
f
),
FP_SCALE
(
-
1
.
0
f
)
},
/* 225deg */
{
FP_SCALE
(
0
.
0
f
),
FP_SCALE
(
-
1
.
414
f
)
},
/* 270deg */
{
FP_SCALE
(
1
.
0
f
),
FP_SCALE
(
-
1
.
0
f
)
}
/* 315deg */
};
static
const
complexf_t
zero
=
{
0
.
0
f
,
0
.
0
f
};
#endif
int
bits
;
if
(
s
->
in_training
)
...
...
libs/spandsp/tests/fax_tests.c
浏览文件 @
fd8c576c
...
...
@@ -863,10 +863,22 @@ int main(int argc, char *argv[])
|
T30_SUPPORT_300_600_RESOLUTION
|
T30_SUPPORT_400_800_RESOLUTION
|
T30_SUPPORT_600_1200_RESOLUTION
);
t30_set_ecm_capability
(
t30_state
[
i
],
use_ecm
);
if
(
use_ecm
)
t30_set_supported_compressions
(
t30_state
[
i
],
T30_SUPPORT_T4_1D_COMPRESSION
|
T30_SUPPORT_T4_2D_COMPRESSION
|
T30_SUPPORT_T6_COMPRESSION
);
{
t30_set_supported_compressions
(
t30_state
[
i
],
T30_SUPPORT_T4_1D_COMPRESSION
|
T30_SUPPORT_T4_2D_COMPRESSION
|
T30_SUPPORT_T6_COMPRESSION
|
T30_SUPPORT_T85_COMPRESSION
|
T30_SUPPORT_T85_L0_COMPRESSION
);
}
else
{
t30_set_supported_compressions
(
t30_state
[
i
],
T30_SUPPORT_T4_1D_COMPRESSION
|
T30_SUPPORT_T4_2D_COMPRESSION
);
}
t30_set_minimum_scan_line_time
(
t30_state
[
i
],
scan_line_time
);
if
(
mode
[
i
]
==
T38_GATEWAY_FAX
)
...
...
libs/spandsp/tests/v17_tests.c
浏览文件 @
fd8c576c
...
...
@@ -122,7 +122,7 @@ static void v17_rx_status(void *user_data, int status)
v17_rx_state_t
*
s
;
int
i
;
int
len
;
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t
*
coeffs
;
#else
complexf_t
*
coeffs
;
...
...
@@ -136,7 +136,7 @@ static void v17_rx_status(void *user_data, int status)
len
=
v17_rx_equalizer_state
(
s
,
&
coeffs
);
printf
(
"Equalizer:
\n
"
);
for
(
i
=
0
;
i
<
len
;
i
++
)
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
printf
(
"%3d (%15.5f, %15.5f)
\n
"
,
i
,
coeffs
[
i
].
re
/
4096
.
0
f
,
coeffs
[
i
].
im
/
4096
.
0
f
);
#else
printf
(
"%3d (%15.5f, %15.5f) -> %15.5f
\n
"
,
i
,
coeffs
[
i
].
re
,
coeffs
[
i
].
im
,
powerf
(
&
coeffs
[
i
]));
...
...
@@ -173,7 +173,7 @@ static int v17getbit(void *user_data)
}
/*- End of function --------------------------------------------------------*/
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
static
void
qam_report
(
void
*
user_data
,
const
complexi16_t
*
constel
,
const
complexi16_t
*
target
,
int
symbol
)
#else
static
void
qam_report
(
void
*
user_data
,
const
complexf_t
*
constel
,
const
complexf_t
*
target
,
int
symbol
)
...
...
@@ -181,7 +181,12 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
{
int
i
;
int
len
;
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t
*
coeffs
;
complexf_t
constel_point
;
#else
complexf_t
*
coeffs
;
#endif
float
fpower
;
v17_rx_state_t
*
rx
;
static
float
smooth_power
=
0
.
0
f
;
...
...
@@ -190,37 +195,53 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
rx
=
(
v17_rx_state_t
*
)
user_data
;
if
(
constel
)
{
fpower
=
(
constel
->
re
-
target
->
re
)
*
(
constel
->
re
-
target
->
re
)
+
(
constel
->
im
-
target
->
im
)
*
(
constel
->
im
-
target
->
im
);
#if defined(SPANDSP_USE_FIXED_POINT)
fpower
/=
4096
.
0
*
4096
.
0
;
#endif
smooth_power
=
0
.
95
f
*
smooth_power
+
0
.
05
f
*
fpower
;
#if defined(ENABLE_GUI)
if
(
use_gui
)
{
#if defined(SPANDSP_USE_FIXED_POINT)
constel_point
.
re
=
constel
->
re
/
4096
.
0
;
constel_point
.
im
=
constel
->
im
/
4096
.
0
;
qam_monitor_update_constel
(
qam_monitor
,
&
constel_point
);
#else
qam_monitor_update_constel
(
qam_monitor
,
constel
);
#endif
qam_monitor_update_carrier_tracking
(
qam_monitor
,
v17_rx_carrier_frequency
(
rx
));
qam_monitor_update_symbol_tracking
(
qam_monitor
,
v17_rx_symbol_timing_correction
(
rx
));
}
#endif
fpower
=
(
constel
->
re
-
target
->
re
)
*
(
constel
->
re
-
target
->
re
)
+
(
constel
->
im
-
target
->
im
)
*
(
constel
->
im
-
target
->
im
);
smooth_power
=
0
.
95
f
*
smooth_power
+
0
.
05
f
*
fpower
;
printf
(
"%8d [%8.4f, %8.4f] [%8.4f, %8.4f] %2x %8.4f %8.4f %9.4f %7.3f %7.4f
\n
"
,
symbol_no
,
#if defined(SPANDSP_USE_FIXED_POINT)
constel
->
re
/
4096
.
0
,
constel
->
im
/
4096
.
0
,
target
->
re
/
4096
.
0
,
target
->
im
/
4096
.
0
,
#else
constel
->
re
,
constel
->
im
,
target
->
re
,
target
->
im
,
#endif
symbol
,
fpower
,
smooth_power
,
v17_rx_carrier_frequency
(
rx
),
v17_rx_signal_power
(
rx
),
v17_rx_symbol_timing_correction
(
rx
));
printf
(
"Carrier %d %f %f
\n
"
,
symbol_no
,
v17_rx_carrier_frequency
(
rx
),
v17_rx_symbol_timing_correction
(
rx
));
//
printf("Carrier %d %f %f\n", symbol_no, v17_rx_carrier_frequency(rx), v17_rx_symbol_timing_correction(rx));
symbol_no
++
;
if
(
--
update_interval
<=
0
)
{
len
=
v17_rx_equalizer_state
(
rx
,
&
coeffs
);
printf
(
"Equalizer A:
\n
"
);
for
(
i
=
0
;
i
<
len
;
i
++
)
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
printf
(
"%3d (%15.5f, %15.5f)
\n
"
,
i
,
coeffs
[
i
].
re
/
4096
.
0
f
,
coeffs
[
i
].
im
/
4096
.
0
f
);
#else
printf
(
"%3d (%15.5f, %15.5f) -> %15.5f
\n
"
,
i
,
coeffs
[
i
].
re
,
coeffs
[
i
].
im
,
powerf
(
&
coeffs
[
i
]));
...
...
@@ -228,7 +249,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
#if defined(ENABLE_GUI)
if
(
use_gui
)
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
qam_monitor_update_int_equalizer
(
qam_monitor
,
coeffs
,
len
);
#else
qam_monitor_update_equalizer
(
qam_monitor
,
coeffs
,
len
);
...
...
libs/spandsp/tests/v22bis_tests.c
浏览文件 @
fd8c576c
...
...
@@ -115,7 +115,7 @@ static void v22bis_rx_status(void *user_data, int status)
int
bit_rate
;
int
i
;
int
len
;
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t
*
coeffs
;
#else
complexf_t
*
coeffs
;
...
...
@@ -132,7 +132,7 @@ static void v22bis_rx_status(void *user_data, int status)
len
=
v22bis_rx_equalizer_state
(
s
->
v22bis
,
&
coeffs
);
printf
(
"Equalizer:
\n
"
);
for
(
i
=
0
;
i
<
len
;
i
++
)
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
printf
(
"%3d (%15.5f, %15.5f)
\n
"
,
i
,
coeffs
[
i
].
re
/
1024
.
0
f
,
coeffs
[
i
].
im
/
1024
.
0
f
);
#else
printf
(
"%3d (%15.5f, %15.5f) -> %15.5f
\n
"
,
i
,
coeffs
[
i
].
re
,
coeffs
[
i
].
im
,
powerf
(
&
coeffs
[
i
]));
...
...
@@ -171,7 +171,7 @@ static int v22bis_getbit(void *user_data)
}
/*- End of function --------------------------------------------------------*/
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
static
void
qam_report
(
void
*
user_data
,
const
complexi16_t
*
constel
,
const
complexi16_t
*
target
,
int
symbol
)
#else
static
void
qam_report
(
void
*
user_data
,
const
complexf_t
*
constel
,
const
complexf_t
*
target
,
int
symbol
)
...
...
@@ -179,7 +179,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
{
int
i
;
int
len
;
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t
*
coeffs
;
complexf_t
constel_point
;
#else
...
...
@@ -194,7 +194,13 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
#if defined(ENABLE_GUI)
if
(
use_gui
)
{
#if defined(SPANDSP_USE_FIXED_POINT)
constel_point
.
re
=
constel
->
re
/
1024
.
0
;
constel_point
.
im
=
constel
->
im
/
1024
.
0
;
qam_monitor_update_constel
(
s
->
qam_monitor
,
&
constel_point
);
#else
qam_monitor_update_constel
(
s
->
qam_monitor
,
constel
);
#endif
qam_monitor_update_carrier_tracking
(
s
->
qam_monitor
,
v22bis_rx_carrier_frequency
(
s
->
v22bis
));
qam_monitor_update_symbol_tracking
(
s
->
qam_monitor
,
v22bis_rx_symbol_timing_correction
(
s
->
v22bis
));
}
...
...
@@ -205,10 +211,17 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
printf
(
"%8d [%8.4f, %8.4f] [%8.4f, %8.4f] %2x %8.4f %8.4f %8.4f
\n
"
,
s
->
symbol_no
,
#if defined(SPANDSP_USE_FIXED_POINT)
constel
->
re
/
1024
.
0
,
constel
->
im
/
1024
.
0
,
target
->
re
/
1024
.
0
,
target
->
im
/
1024
.
0
,
#else
constel
->
re
,
constel
->
im
,
target
->
re
,
target
->
im
,
#endif
symbol
,
fpower
,
s
->
smooth_power
,
...
...
@@ -221,7 +234,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
len
=
v22bis_rx_equalizer_state
(
s
->
v22bis
,
&
coeffs
);
printf
(
"Equalizer A:
\n
"
);
for
(
i
=
0
;
i
<
len
;
i
++
)
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
printf
(
"%3d (%15.5f, %15.5f)
\n
"
,
i
,
coeffs
[
i
].
re
/
1024
.
0
f
,
coeffs
[
i
].
im
/
1024
.
0
f
);
#else
printf
(
"%3d (%15.5f, %15.5f) -> %15.5f
\n
"
,
i
,
coeffs
[
i
].
re
,
coeffs
[
i
].
im
,
powerf
(
&
coeffs
[
i
]));
...
...
@@ -229,7 +242,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
#if defined(ENABLE_GUI)
if
(
use_gui
)
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
qam_monitor_update_int_equalizer
(
s
->
qam_monitor
,
coeffs
,
len
);
#else
qam_monitor_update_equalizer
(
s
->
qam_monitor
,
coeffs
,
len
);
...
...
libs/spandsp/tests/v27ter_tests.c
浏览文件 @
fd8c576c
...
...
@@ -118,7 +118,7 @@ static void v27ter_rx_status(void *user_data, int status)
v27ter_rx_state_t
*
s
;
int
i
;
int
len
;
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t
*
coeffs
;
#else
complexf_t
*
coeffs
;
...
...
@@ -132,7 +132,7 @@ static void v27ter_rx_status(void *user_data, int status)
len
=
v27ter_rx_equalizer_state
(
s
,
&
coeffs
);
printf
(
"Equalizer:
\n
"
);
for
(
i
=
0
;
i
<
len
;
i
++
)
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
printf
(
"%3d (%15.5f, %15.5f)
\n
"
,
i
,
coeffs
[
i
].
re
/
4096
.
0
f
,
coeffs
[
i
].
im
/
4096
.
0
f
);
#else
printf
(
"%3d (%15.5f, %15.5f) -> %15.5f
\n
"
,
i
,
coeffs
[
i
].
re
,
coeffs
[
i
].
im
,
powerf
(
&
coeffs
[
i
]));
...
...
@@ -169,7 +169,7 @@ static int v27tergetbit(void *user_data)
}
/*- End of function --------------------------------------------------------*/
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
static
void
qam_report
(
void
*
user_data
,
const
complexi16_t
*
constel
,
const
complexi16_t
*
target
,
int
symbol
)
#else
static
void
qam_report
(
void
*
user_data
,
const
complexf_t
*
constel
,
const
complexf_t
*
target
,
int
symbol
)
...
...
@@ -177,7 +177,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
{
int
i
;
int
len
;
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t
*
coeffs
;
complexf_t
constel_point
;
#else
...
...
@@ -196,23 +196,43 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
{
fpower
=
(
constel
->
re
-
target
->
re
)
*
(
constel
->
re
-
target
->
re
)
+
(
constel
->
im
-
target
->
im
)
*
(
constel
->
im
-
target
->
im
);
#if defined(SPANDSP_USE_FIXED_POINT)
fpower
/=
1024
.
0
*
1024
.
0
;
#endif
smooth_power
=
0
.
95
f
*
smooth_power
+
0
.
05
f
*
fpower
;
#if defined(ENABLE_GUI)
if
(
use_gui
)
{
#if defined(SPANDSP_USE_FIXED_POINT)
constel_point
.
re
=
constel
->
re
/
1024
.
0
;
constel_point
.
im
=
constel
->
im
/
1024
.
0
;
qam_monitor_update_constel
(
qam_monitor
,
&
constel_point
);
#else
qam_monitor_update_constel
(
qam_monitor
,
constel
);
#endif
qam_monitor_update_carrier_tracking
(
qam_monitor
,
v27ter_rx_carrier_frequency
(
rx
));
qam_monitor_update_symbol_tracking
(
qam_monitor
,
v27ter_rx_symbol_timing_correction
(
rx
));
}
#endif
error
=
constel
->
im
*
target
->
re
-
constel
->
re
*
target
->
im
;
#if defined(SPANDSP_USE_FIXED_POINT)
printf
(
"Tracking error %f %f %f %f %f %f
\n
"
,
error
,
v27ter_rx_carrier_frequency
(
rx
),
constel
->
re
/
1024
.
0
,
constel
->
im
/
1024
.
0
,
target
->
re
/
1024
.
0
,
target
->
im
/
1024
.
0
);
#else
printf
(
"Tracking error %f %f %f %f %f %f
\n
"
,
error
,
v27ter_rx_carrier_frequency
(
rx
),
constel
->
re
,
constel
->
im
,
target
->
re
,
target
->
im
);
#endif
printf
(
"%8d [%8.4f, %8.4f] [%8.4f, %8.4f] %2x %8.4f %8.4f %9.4f %7.3f %7.4f
\n
"
,
symbol_no
,
#if defined(SPANDSP_USE_FIXED_POINT)
constel
->
re
/
1024
.
0
,
constel
->
im
/
1024
.
0
,
target
->
re
/
1024
.
0
,
target
->
im
/
1024
.
0
,
#else
constel
->
re
,
constel
->
im
,
target
->
re
,
target
->
im
,
#endif
symbol
,
fpower
,
smooth_power
,
...
...
@@ -222,7 +242,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
len
=
v27ter_rx_equalizer_state
(
rx
,
&
coeffs
);
printf
(
"Equalizer B:
\n
"
);
for
(
i
=
0
;
i
<
len
;
i
++
)
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
printf
(
"%3d (%15.5f, %15.5f)
\n
"
,
i
,
coeffs
[
i
].
re
/
1024
.
0
f
,
coeffs
[
i
].
im
/
1024
.
0
f
);
#else
printf
(
"%3d (%15.5f, %15.5f) -> %15.5f
\n
"
,
i
,
coeffs
[
i
].
re
,
coeffs
[
i
].
im
,
powerf
(
&
coeffs
[
i
]));
...
...
@@ -236,7 +256,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
{
if
(
++
reports
>=
1000
)
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
qam_monitor_update_int_equalizer
(
qam_monitor
,
coeffs
,
len
);
#else
qam_monitor_update_equalizer
(
qam_monitor
,
coeffs
,
len
);
...
...
@@ -253,7 +273,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
len
=
v27ter_rx_equalizer_state
(
rx
,
&
coeffs
);
printf
(
"Equalizer A:
\n
"
);
for
(
i
=
0
;
i
<
len
;
i
++
)
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
printf
(
"%3d (%15.5f, %15.5f)
\n
"
,
i
,
coeffs
[
i
].
re
/
1024
.
0
f
,
coeffs
[
i
].
im
/
1024
.
0
f
);
#else
printf
(
"%3d (%15.5f, %15.5f) -> %15.5f
\n
"
,
i
,
coeffs
[
i
].
re
,
coeffs
[
i
].
im
,
powerf
(
&
coeffs
[
i
]));
...
...
@@ -261,7 +281,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
#if defined(ENABLE_GUI)
if
(
use_gui
)
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
qam_monitor_update_int_equalizer
(
qam_monitor
,
coeffs
,
len
);
#else
qam_monitor_update_equalizer
(
qam_monitor
,
coeffs
,
len
);
...
...
libs/spandsp/tests/v29_tests.c
浏览文件 @
fd8c576c
...
...
@@ -169,7 +169,7 @@ static int v29getbit(void *user_data)
}
/*- End of function --------------------------------------------------------*/
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
static
void
qam_report
(
void
*
user_data
,
const
complexi16_t
*
constel
,
const
complexi16_t
*
target
,
int
symbol
)
#else
static
void
qam_report
(
void
*
user_data
,
const
complexf_t
*
constel
,
const
complexf_t
*
target
,
int
symbol
)
...
...
@@ -200,7 +200,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
#if defined(ENABLE_GUI)
if
(
use_gui
)
{
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
constel_point
.
re
=
constel
->
re
/
4096
.
0
;
constel_point
.
im
=
constel
->
im
/
4096
.
0
;
qam_monitor_update_constel
(
qam_monitor
,
&
constel_point
);
...
...
@@ -214,7 +214,7 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex
#endif
printf
(
"%8d [%8.4f, %8.4f] [%8.4f, %8.4f] %2x %8.4f %8.4f %9.4f %7.3f %7.4f
\n
"
,
symbol_no
,
#if defined(SPANDSP_USE_FIXED_POINT
x
)
#if defined(SPANDSP_USE_FIXED_POINT)
constel
->
re
/
4096
.
0
,
constel
->
im
/
4096
.
0
,
target
->
re
/
4096
.
0
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论