本文档主要介绍
RK3308 VAD相关寄存器配置及调参说明。
1、概述
本文档主要针对 RK3308 语音检测
模块(VAD, Voice Activity Detection)常用寄存器对应参数说明和寄存器配置方法。
2、寄存器配置方法
2.1 查看寄存器
查看 VAD 相关寄存器可以使用命令 cat /sys/
kernel/debug/vad/reg 查看当前 VAD 寄存器值,如下图:
2.2 寄存器配置
寄存器配置示例如下图:
3、常用寄存器说明
RK3308 VAD 寄存器 0x005c 说明
Address: Operational Base + offset (0x005c)
Bit | Attr | Reset Value | Description |
31:24 | RO | 0x0 | reserved |
23:16 | RW | 0x02 | vad_con_thd When continuous sample number(>=vad_con_thd) exceed threshold, then Assert the vad_det interrupt, the value N means N + l. When this value is higher, the voice detect condition is more strict |
15 | RO | 0x0 | reserved |
14:12 | RW | 0x4 | noisejevel Noise level, valid value is 0xl~0x6 when this value is higher, the voice detect condition is more strict |
11:10 | RO | 0x0 | reserved |
9:0 | RW | 0x020 | gain The gain control of voice data, because of truncation 5 bits of result when the value is 32, the gain is 1 when the value is 64, the gain is 2 when is value is 16 the gain is 1/2 |
4、调试参数说明
表 1 和表 2 分别是寄存器 0x5c 和 0x60 说明,在调试 vad 参数的时候,根据应用场景,选取最优的参数值。其中,几个比较重要的调试参数说明如下:
4.1 sound_thd
sound_thd 对应寄存器地址为 0x60 的 0~15bit,表示在应用场景下,纯净语音(理论上是这个值是无噪声环境下的语音幅度值,但是无噪声环境实现难度较大,因此一般选取安静环境下的语音)的最小幅度值的绝对值。sound_thd 的取值范围为:0~2^15。
例如,应用场景为 5 米外说“灵犀灵犀”唤醒,那么 sound_thd 的调参方法为:在安静环境下 5m 距 离,抓取“灵犀灵犀”的
raw PCM 数据,“灵犀灵犀”声音起点的最低幅度值,由于抓取的语音数据不可能是纯净语音,因此,sound_thd 的选取可适当的减去当前环境噪声值。
4.2 gain
gain 对应寄存器地址为 0x5c 的 0~9bit,表示对 vad 输入
信号的线性放大。放大倍数为 g 计算公 式:
放大倍数 g 的取值范围为,-16~15.9689。 当 vad 的输入信号幅度较小时,在同等信噪比语音下,噪声与声音信号的落差较小,因此需要对信号进行线性放大,增大噪声与声音信号的落差值。
更多详细内容请下载附件查看