Open SiyuanWei opened 2 years ago
@motus, @hdubey:
The above is almost definitely a bug, causing wrong SNR in the noisyspeech
signal
noisyspeech = clean + noisenewlevel
As pointed out above, and also in #53, noise scaling in noisescalar
is calculated using rmsclean
and rmsnoise
.
However, both clean
and noise
have already been normalized to target_level
. Therefore, the final scaled noise noisenewlevel
will not have the correct level.
This can be easily tested by running segmental_snr_mixer
with inputs clean
and noise
with different distributions, for example,
clean = np.random.rand(N) - 0.5
noise = np.random.randn(N)
This may have a significant impact on the SNR distribution in the generated data and on analysis of the results.
I agree with @anteju, this is definitely a bug that needs to be fixed. Otherwise, the resulting generated noisy data will have incorrect SNR.
While the clean audio and noise audio have already been normalized based on the RMS, I'm wondering that whether the noisescalar should be multiplied by rms_clean/ rms_noise..