[ES8388] 降低麥克風的雜音

麥克風可以進行錄音的功能,但是持續性的背景雜音過大,經尋問廠商後,廠商說明雜音可能是硬體線路的電源或地造成的。

建議的調整方式為:
1、將某個音量以下的聲音視為雜音,並執行過濾的動作。
2、調整 PGA gain 值為最大(+24dB)。
3、調整 ALC(Automatic Level Control) 功能的 ALC Maximum Gain 值及 ALC Minimum Gain 值為 +17.5 dB 及 +6 dB。

以下將對這三種方式進行說明。

 

 

將某個音量以下的聲音視為雜音,並執行過濾的動作

這個功能的名稱 Noise gate function,經測試,此方法的確可以過濾雜音,不過說話時的雜音,還是會被錄進來,同時也因為有說話聲的關係,所以雜音變得較不明顯。
另一個副作用是,錄音的品質會受影響,因為在音調的變換中,聲音過小的部分,會被視為雜音而去除。

本文將說明如何啟用 Noise gate function 的功能,及所使用到的音量單位 - dBFS 的函意。

 

Noise gate function 相關的暫存器(0x16) 說明如下: (ES8388.pdf)
image

NGAT 的值 1 或 0,表示是否啟用 Noise gate function 的功能。
NGG 的值 x0, 01, 11 分別表示對待 noise 的處理方式。
NGTH 的值表示為 threshold,單位為 - dBFS,在這個 threshold 下的聲音會被當作 noise 處理。

 

舉例來說,如果在 driver - es8388.c 中,將 register 22 (=0x16) 的值設為 0xab:
snd_soc_component_write(component, 0x16, 0xab);
表示:(0xab = b10101 01 1)

NGAT 的值為 b1, enable。 也就是啟用 Noise gate function 的功能。
NGG 的值為 b01,mute ADC output。 也就是對待 noise 的處理方式為 mute (靜音)。
NGTH 的值為 b10101,-45 dBFS。 也就是音量在 -45 dBFS 以下的聲音會被視為 noise。

 

ES8388 User Guide 原文如下:

Noise Gate Enable / Noise Gate Threshold / Noise Gate Type.
The Noise Gate function is enabled by setting the register field NGAT.
When enabled, the Noise Gate Threshold can be programmed using the NGTH register field.
The range of Noise Gate Threshold varies between -76.5dBFS and -30dBFS with 1.5dBFS per step; this threshold is the input signal level below which the PGA gain will either be muted or be held constant.
The Noise Gate type (Mute or Hold Gain) can be set by register field NGG.

 

 

數位訊號的標準 – dBFS

在數位訊號中,只要音量超過數值可以記錄的範圍就一定會產生破音失真的情形,所以在數位訊號中,將「最大且沒有失真的音量」作為參考值(也就是 0 dBFS),所有大於 0 dBFS 的聲音一定是破音失真的聲音,而沒有失真的聲音一定是小於參考值的,分貝值就會「小於 0」。
image

 

 

調整 PGA gain 值為最大(+24dB)

何謂 PGA gain 值?

當使用麥克風錄製人聲或樂器時。麥克風通過將空氣中的振動轉換為微弱的電信號,當聲波到達麥克風的感件時,氣壓的變化變成了電壓的變化,這就是聲音。
然而,這個聲音的信號其實是很小的,它需要被放大數倍才能達到錄音介面接受的音量,而 Gain 是 Pre-Amp 前級將聲音放大的術語。也就是說,錄音介面通常會有一個可以放大麥克風訊號的Pre-amp 前級,增加訊號的量,這個過程就是放大 Gain 值了。

另一方面,volume 是指聲音的感知水平,指的是人耳的主觀感受,也就是我們常說的大小聲。

所以簡單的結論是: gain 是將輸入的值變大,所以到最後輸出 volume 也會變大些; 而 volume 則是將整體的輸出變大。
也就是說,調大 gain 值,只會將麥克風的收音放大,而調大 volume,則可能會同時也把雜音放大。

 

何謂 PGA?

PGA: 可編程增益放大器(Programmable Gain Amplifier, PGA) 本質上是一種具有用戶可編程增益的同相放大器。

也就是隨著調整 PGA gain 值,使得在收音時的訊號量隨之調整的功能。

 

PGA gain 相關的暫存器(0x09) 說明如下: (ES8388.pdf)
image

 

 

調整 ALC(Automatic Level Control) 功能的 ALC Maximum Gain 值及 ALC Minimum Gain 值為 +17.5 dB 及 +6 dB

何謂 ALC?

在提供錄音功能的應用中,可以透過 ALC 功能將錄下的信號保持在一定的輸出音量。

舉例來說,錄音時,信號可能會有很大差異,具體取決於用戶說話的音量或麥克風跟嘴巴之間的距離,這將導致錄製的信號在回放時難以聽清。
ALC 的目的是保持恆定的輸出音量,而不管輸入信號電平如何。這是通過不斷地實現調整 PGA 增益,使 ADC 輸出端的信號電平保持恆定。

原文如下: (ES8388 user Guide.pdf)
In applications that offer a recording feature, ALC is often desirable to keep the recorded signal at a constant level.
For example, if recording voice, the signal may vary a great deal depending on how loud the user speaks or how close to the mouth the microphone is
held. This will result in a recorded signal that is difficult to listen to when played back.
The purpose of the ALC is to keep a constant output volume irrespective of the input signal level. This is achieved by continually
adjusting the PGA gain so that the signal level at the ADC output remains constant.

 

ALC 相關的暫存器(0x12) 說明如下: (ES8388.pdf)

image

跟 ALC 相關的暫存器還有:
image

其暫存器值如下: Reg 19: c0,Reg 20: 05,Reg 21: 06,廠商說明保留原值即可。

 

 

Reference

一次搞懂常見的「分貝」

Gain、Level、Volume的差別

 

文字內容 或 影像內容 部份參考、引用自網路,如有侵權,請告知。

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 silverwind1982 的頭像
    silverwind1982

    拾人牙慧

    silverwind1982 發表在 痞客邦 留言(0) 人氣()