Real Time Voice Activity Detection by Spectral Energy by MATLAB
Tutorial #4
Published in
Apr 8, 2019
Download Source Code
- (Free P code) Download for MATLAB
- (M file based on spectrum) Donate 30 USD
- (Python based on log energy) Donate 30 USD
Description
- Plot signal wave in time or frequency domain
- Choose x-axis as time or samples
- Remove spectral energy under a value when show the spectrogram
Function
sys = vadRealTime_YW(fs, screen, th)
- Required Input Parameters
fs Sampling frequency (Hz). Default is 16k.
screen Screen width to show signal (sec). Default is 2 sec.
th Threshold energy for removal. Default is 100.
Example
Start the system by sample rate 16k and show 2 seconds signal.
sys = realTime_YW(16000, 2, 100);
Stop the system.
stop(sys.clock);
stop(sys.recorder);
Get the record speech, plot and play it.
s = getaudiodata(sys.recorder);
figure;
plot(s);
sound(s,16000);