WebRTC AGC(自动增益控制) [英] WebRTC AGC (Automatic Gain Control)

查看:38
本文介绍了WebRTC AGC(自动增益控制)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试 WebRTC AGC,但我一定是做错了什么,因为信号只是未经修改地通过.

I am testing the WebRTC AGC but I must be doing something wrong because the signal just passes through unmodified.

以下是我创建和初始化 AGC 的方法:

Here's how I create and initialize the AGC:

agcConfig.compressionGaindB = 9;
agcConfig.limiterEnable = 1;
agcConfig.targetLevelDbfs = 9;   /* 9dB below full scale */

WebRtcAgc_Create(&agc);
WebRtcAgc_Init(agc, minLevel, maxLevel, kAgcModeFixedDigital, 8000);
WebRtcAgc_set_config(agc, agcConfig);

然后对于每个 10ms 的样本块,我执行以下操作:

And then for each 10ms sample block I do the following:

WebRtcAgc_Process(agc, micData, NULL, 80, micData, NULL, micLevelIn, &micLevelOut, 0, &saturationWarning);

其中 micLevelIn 设置为 0.

谁能告诉我我做错了什么?

Can somebody tell me what I'm doing wrong?

我预计全量程正弦音会衰减到目标 DBFS 级别;低电平正弦音(即 -30dBFS)将被放大以匹配目标 DBFS 电平.但这不是我所看到的.

I expected that a full scale sine tone would be attenuated to the target DBFS level; and a low level sine tone (i.e. -30dBFS) would be amplified to match the target DBFS level. But that's not what I'm seeing.

推荐答案

以下是用于 Webrtc_AGC 的操作顺序:

Here is the sequence of operations to be used for Webrtc_AGC:

  1. 创建AGC:WebRtcAgc_Create
  2. 初始化AGC:WebRtcAgc_Init
  3. 设置配置:WebRtcAgc_set_config
  4. 初始化capture_level = 0
  5. 对于kAgcModeAdaptiveDigital,调用VirtualMic:WebRtcAgc_VirtualMic
  6. 使用 capture_level 处理缓冲区:WebRtcAgc_Process
  7. 获取从WebRtcAgc_Process返回的输出捕获级别并将其设置为capture_level
  8. 音频缓冲区
  9. 重复 5 到 7
  10. 摧毁 AGC:WebRtcAgc_Free
  1. Create AGC: WebRtcAgc_Create
  2. Initialize AGC: WebRtcAgc_Init
  3. Set Config: WebRtcAgc_set_config
  4. Initialize capture_level = 0
  5. For kAgcModeAdaptiveDigital, invoke VirtualMic: WebRtcAgc_VirtualMic
  6. Process Buffer with capture_level: WebRtcAgc_Process
  7. Get the out capture level returned from WebRtcAgc_Process and set it to capture_level
  8. Repeat 5 to 7 for the audio buffers
  9. Destroy the AGC: WebRtcAgc_Free

检查 webrtc/modules/audio_processing/gain_control_impl.cc 以供参考.

Check webrtc/modules/audio_processing/gain_control_impl.cc for reference.

这篇关于WebRTC AGC(自动增益控制)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆