Enny1991 / beamformers

Easy to use Beamformers for multi-channel speech separation/enhancement
MIT License
171 stars 48 forks source link

how to get param 'noise' in the case of speech enhancement #3

Open zhaobin-00 opened 3 years ago

zhaobin-00 commented 3 years ago

Hi: I want to apply beamforming for speech enhancement, but the param noise I don't understand. If I want to perform speech enhancement and I only have mixture, what should be the parameter noise in this case? For example:

def TD_MVDR(mixture, noise, target=None, frame_len=512, frame_step=1):
    """ 
    :param mixture: nd_array (n_mics, time) of the mixture recordings
    :param noise: nd_array (n_mics, time) of the noise recordings
    :param target: nd_array (n_mics, time) of the target recordings
    :param frame_len:
    :param frame_step:
    :return: the enhanced signal
    """

How do I set parameter noise? Thanks.

Enny1991 commented 3 years ago

Hi! So the parameter noise should be a sample of the noise you are working with. Let's say for example you want to do speech enhancement and you have some recordings, the mixture is a piece of this recording where you have voice + noise while the noise is a piece of this recording when you only have noise. The assumptions for MVDR is that the statistics of the noise are known, and to estimate the statistics of the noise you need a noise sample. Does that make sense?

zhaobin-00 commented 3 years ago

Thanks for your explanation. Forgive me for being a novice. I have another question. Can the piece of noise be multi-channel or a certain channel? Do we usually choose multi-channel noise pieces directly?

Enny1991 commented 3 years ago

Yes multichannel directly as the beamformer estimates the spatial covariance of the noise, thus you need all the channels!

zhaobin-00 commented 3 years ago

Thanks!

MrSupW commented 1 year ago

@Enny1991 Sorry to bother you. Should I prepare a noisy wav for each mixture wav?Or I just need one noise piece for all mixture wavs. And what will happen if I set the noisy zero like the mixture wav? Does it still have the enhancement for the mixture wav?

Enny1991 commented 1 year ago

@MrSupW One noise piece is all you need if the noise is always the same (i.e. has the same spatial and frequency components). A noise with only zeroes will actually not allow the beamformer to be estimated, you need a sample fo the noise for the beamfoerm to work.