Voice Activity Detection by Spectral Energy by MATLAB
Tutorial #3
Published in
1 min readApr 1, 2019
Download Source Code
Description
- Speech activity detection (VAD) by spectral energy
- Return end points of their sample index
Function
[activeNum, pos] = vad_YW(speech, fs, plotMode, activeBuffer, activeMax, energyTh2)
- Required Input Parameters
speech Speech data
fs Sampling frequency (Hz)
- Optional Input Parameters
plotMode 0: don't plot anything
1: plot VAD result in time domain signal
2: plot all of segments of active parts respectively
3: plot all of above mentioned
activeBuffer Buffer range in two sides (sec)
activeMax Max active length (sec)
energyTh2 Under spectral energy for removal
- Output Parameters
activeNum The amount of active speech segment
pos Active segments samples position
Example
Input a audio file.
[ speech, fs] = audioread( 'Music_SNR_5_0.wav' );
Execute the VAD and plotMode is 3
[ activeNum, pos] = vad_YW(speech, fs, 3);