WebrtcAudio::Vad
Class methods
All pass filtering of |data_in|, used before splitting the signal into two frequency bands (low pass vs high pass). Note that |data_in| and |data_out| can NOT correspond to the same address.
- data_in [i] : Input audio signal given in Q0.
- data_length [i] : Length of input and output data.
- filter_coefficient [i] : Given in Q15.
- filter_state [i/o] : State of the filter given in Q(-1).
- data_out [o] : Output audio signal given in Q(-1).
Calculates the probabilities for both speech and background noise using Gaussian Mixture Models (GMM). A hypothesis-test is performed to decide which type of signal is most probable.
-
self [i/o] : Pointer to VAD instance
-
features [i] : Feature vector of length |kNumChannels| = log10(energy in frequency band)
-
total_power [i] : Total power in audio frame.
-
frame_length [i] : Number of input samples
-
returns : the VAD decision (0 - noise, 1 - speech).
High pass filtering, with a cut-off frequency at 80 Hz, if the |data_in| is sampled at 500 Hz.
- data_in [i] : Input audio data sampled at 500 Hz.
- data_length [i] : Length of input and output data.
- filter_state [i/o] : State of the filter.
- data_out [o] : Output audio data in the frequency interval 80 - 250 Hz.
Initialize the VAD. Set aggressiveness mode to default value.
Allpass filter coefficients, upper and lower, in Q15. Upper: 0.64, Lower: 0.17
Calculates the energy of |data_in| in dB, and also updates an overall |total_energy| if necessary.
- data_in [i] : Input audio data for energy calculation.
- data_length [i] : Length of input data.
- offset [i] : Offset value added to |log_energy|.
- total_energy [i/o] : An external energy updated with the energy of |data_in|. NOTE: |total_energy| is only updated if |total_energy| <= |kMinEnergy|.
- log_energy [o] : 10 * log10("energy of |data_in|") given in Q4.
An s16 x s32 -> s32 multiplication that's allowed to overflow. (It's still undefined behavior, so not a good idea; this just makes UBSan ignore the violation, so that our old code can continue to do what it's always been doing.)
Calculates the weighted average w.r.t. number of Gaussians. The |data| are updated with an |offset| before averaging.
- data [i/o] : Data to average.
- offset [i] : An offset added to |data|.
- weights [i] : Weights used for averaging.
returns : The weighted average.