espnet2.enh.layers.beamformer.prepare_beamformer_stats
Less than 1 minute
espnet2.enh.layers.beamformer.prepare_beamformer_stats
espnet2.enh.layers.beamformer.prepare_beamformer_stats(signal, masks_speech, mask_noise, powers=None, beamformer_type='mvdr', bdelay=3, btaps=5, eps=1e-06)
Prepare necessary statistics for constructing the specified beamformer.
- Parameters:
- signal (torch.complex64/ComplexTensor) – (…, F, C, T)
- masks_speech (List *[*torch.Tensor ]) – (…, F, C, T) masks for all speech sources
- mask_noise (torch.Tensor) – (…, F, C, T) noise mask
- powers (List *[*torch.Tensor ]) – powers for all speech sources (…, F, T) used for wMPDR or WPD beamformers
- beamformer_type (str) – one of the pre-defined beamformer types
- bdelay (int) – delay factor, used for WPD beamformser
- btaps (int) – number of filter taps, used for WPD beamformser
- eps (torch.Tensor) – tiny constant
- Returns: a dictionary containing all necessary statistics : e.g. “psd_n”, “psd_speech”, “psd_distortion” Note: * When masks_speech is a tensor or a single-element list, all returned
statistics are tensors;
- When masks_speech is a multi-element list, some returned statistics can be a list, e.g., “psd_n” for MVDR, “psd_speech” and “psd_distortion”.
- Return type: beamformer_stats (dict)