espnet2.enh.layers.beamformer.blind_analytic_normalization
Less than 1 minute
espnet2.enh.layers.beamformer.blind_analytic_normalization
espnet2.enh.layers.beamformer.blind_analytic_normalization(ws, psd_noise, eps=1e-08)
Blind analytic normalization (BAN) for post-filtering.
This function normalizes the beamformer vector using blind analytic normalization, which is useful in the context of speech enhancement and noise reduction.
- Parameters:
- ws (torch.complex64/ComplexTensor) – Beamformer vector of shape (…, F, C).
- psd_noise (torch.complex64/ComplexTensor) – Noise Power Spectral Density (PSD) matrix of shape (…, F, C, C).
- eps (float , optional) – A small constant to avoid division by zero. Default is 1e-8.
- Returns: Normalized beamformer vector of shape (…, F).
- Return type: ws_ban (torch.complex64/ComplexTensor)
Examples
>>> ws = torch.randn(2, 3, 4, dtype=torch.complex64)
>>> psd_noise = torch.randn(2, 3, 4, 4, dtype=torch.complex64)
>>> normalized_ws = blind_analytic_normalization(ws, psd_noise)
NOTE
The normalization helps in enhancing the robustness of the beamformer against noise and improves the overall performance in applications like speech recognition and enhancement.