asteroid.dsp.vad module¶
-
asteroid.dsp.vad.
ebased_vad
(mag_spec, th_db: int = 40)[source]¶ Compute energy-based VAD from a magnitude spectrogram (or equivalent).
Parameters: - mag_spec (torch.Tensor) – the spectrogram to perform VAD on. Expected shape (batch, *, freq, time). The VAD mask will be computed independently for all the leading dimensions until the last two. Independent of the ordering of the last two dimensions.
- th_db (int) – The threshold in dB from which a TF-bin is considered silent.
Returns: torch.BoolTensor
, the VAD mask.- Examples
>>> import torch >>> mag_spec = torch.abs(torch.randn(10, 2, 65, 16)) >>> batch_src_mask = ebased_vad(mag_spec)