Audio noise reduction use WebRTC

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/tanningzhong/article/details/88664338

ns webrtc principle: the data 50 used to construct the noise model before starting, the signal strength 200 before starting to calculate a normalized spectrum difference calculation. The two probability models used to calculate the objective function for each frame and the signal to noise ratio to distinguish a noise and a sound, signal to noise ratio is then calculated according to the frequency domain using a Wiener filter for noise cancellation of the noise signal, and finally in likelihood ratio output noise after the repair data and adjusted in accordance with the energy ratio and signal to noise before and after the noise reduction.

In the study webrtc noise reduction module, here briefly how to use webrtc noise reduction module.

1, create noise handle:

* = NULL pNS_inst NsHandle;
 
WebRtcNs_Create (& pNS_inst);
2, noise initialization handle

 WebRtcNs_Init (pNS_inst, samplerate); // samplerate may 8000, 16000,32000
3, setting noise reduction strategy

WebRtcNs_set_policy (pNS_inst, nMode); // nMode may 0,1,2,3
4, first need to use the filter function to high and low frequency sub-audio data, to high and low frequency noise reduction function manner inside passed

WebRtcSpl_AnalysisQMF (shBufferIn, in_len, shInL, shInH, filter_state1, filter_state12);
. 5, the noise data required to pass the corresponding high and low frequency noise reduction processing interface, while the data is returned to note the high and low points

 WebRtcNs_Process (pNS_inst, shInL, shInH, shOutL, shOutH);
. 6, if the noise is successful, according to the high and low frequency noise reduction filtering of incoming data interface, the output data is the data processed
 

 WebRtcSpl_SynthesisQMF(shOutL,shOutH,shout__len,shBufferOut,Synthesis_state1,Synthesis_state12);
 

Guess you like

Origin blog.csdn.net/tanningzhong/article/details/88664338