All problems
VAD Energy Threshold
Problem
Return a frame-level voice activity list: 1 when the frame energy is strictly greater than threshold, otherwise 0.
An empty energy list gives an empty result.
Hint
The comparison is strict, so a frame exactly at the threshold is silence.
Test cases
case 1
in: [[0.1,0.5,0.9],0.5]
expected: [0,0,1]
case 2
in: [[1],0]
expected: [1]
case 3
in: [[],0.5]
expected: []
case 4
in: [[0.4,0.6],0.5]
expected: [0,1]
Starter codePython
def vad_energy_threshold(energies, threshold):
# Your code here
pass4 test cases · run your code against them in the editor