Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
42c70840
提交
42c70840
authored
6月 05, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.openzap.org/svn/openzap/trunk@210
a93c3328-9c30-0410-af19-c9cd2b2d52af
上级
9923827d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
43 行增加
和
2 行删除
+43
-2
fsk.c
libs/openzap/src/dsp/fsk.c
+33
-1
fsk.h
libs/openzap/src/dsp/fsk.h
+10
-1
没有找到文件。
libs/openzap/src/dsp/fsk.c
浏览文件 @
42c70840
...
...
@@ -306,7 +306,39 @@ dsp_fsk_sample (dsp_fsk_handle_t *handle, double normalized_sample)
if
(
handle
->
cellpos
>
1
.
0
)
{
handle
->
cellpos
-=
1
.
0
;
(
*
handle
->
attr
.
bithandler
)
(
handle
->
attr
.
bithandler_arg
,
handle
->
current_bit
);
switch
(
handle
->
state
)
{
case
FSK_STATE_DATA
:
(
*
handle
->
attr
.
bithandler
)
(
handle
->
attr
.
bithandler_arg
,
handle
->
current_bit
);
break
;
case
FSK_STATE_CHANSEIZE
:
if
(
handle
->
last_bit
!=
handle
->
current_bit
)
{
handle
->
conscutive_state_bits
++
;
}
else
{
handle
->
conscutive_state_bits
=
0
;
}
if
(
handle
->
conscutive_state_bits
>
15
)
{
handle
->
state
=
FSK_STATE_CARRIERSIG
;
handle
->
conscutive_state_bits
=
0
;
}
break
;
case
FSK_STATE_CARRIERSIG
:
if
(
handle
->
current_bit
)
{
handle
->
conscutive_state_bits
++
;
}
else
{
handle
->
conscutive_state_bits
=
0
;
}
if
(
handle
->
conscutive_state_bits
>
15
)
{
handle
->
state
=
FSK_STATE_DATA
;
handle
->
conscutive_state_bits
=
0
;
}
break
;
}
handle
->
last_bit
=
handle
->
current_bit
;
}
}
libs/openzap/src/dsp/fsk.h
浏览文件 @
42c70840
...
...
@@ -35,6 +35,12 @@
#define __FSK_H__
#include "uart.h"
typedef
enum
{
FSK_STATE_CHANSEIZE
=
0
,
FSK_STATE_CARRIERSIG
,
FSK_STATE_DATA
}
fsk_state_t
;
typedef
struct
dsp_fsk_attr_s
{
int
sample_rate
;
/* sample rate in HZ */
...
...
@@ -46,7 +52,8 @@ typedef struct dsp_fsk_attr_s
typedef
struct
{
dsp_fsk_attr_t
attr
;
/* attributes structure */
fsk_state_t
state
;
dsp_fsk_attr_t
attr
;
/* attributes structure */
double
*
correlates
[
4
];
/* one for each of sin/cos for mark/space */
int
corrsize
;
/* correlate size (also number of samples in ring buffer) */
double
*
buffer
;
/* sample ring buffer */
...
...
@@ -55,8 +62,10 @@ typedef struct
double
celladj
;
/* bit cell adjustment for each sample */
int
previous_bit
;
/* previous bit (for detecting a transition to sync-up cell position) */
int
current_bit
;
/* current bit */
int
last_bit
;
int
downsampling_count
;
/* number of samples to skip */
int
current_downsample
;
/* current skip count */
int
conscutive_state_bits
;
/* number of bits in a row that matches the pattern for the current state */
}
dsp_fsk_handle_t
;
/*
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论