espnet2.enh.layers.beamformer.gev_phase_correction
Less than 1 minute
espnet2.enh.layers.beamformer.gev_phase_correction
espnet2.enh.layers.beamformer.gev_phase_correction(vector)
Phase correction to reduce distortions due to phase inconsistencies.
This function applies phase correction to a beamforming vector to minimize distortions that arise from phase inconsistencies across different frequency channels. It is particularly useful in scenarios involving generalized eigenvalue (GEV) beamformers.
- Parameters:vector (torch.complex64/ComplexTensor) – Beamforming vector with shape (…, F, C), where F is the number of frequency bins and C is the number of channels.
- Returns: Phase corrected beamforming vectors with the same shape as the input.
- Return type: torch.complex64/ComplexTensor
Examples
>>> import torch
>>> vector = torch.rand(2, 5, 3, dtype=torch.complex64) # (B, F, C)
>>> corrected_vector = gev_phase_correction(vector)
>>> print(corrected_vector.shape)
torch.Size([2, 5, 3])
NOTE
The function computes a correction factor for each frequency channel based on the phase angle of the beamforming vector. The correction is applied in the complex domain, adjusting the phase while keeping the magnitude intact.