microsoft / DNS-Challenge

This repo contains the scripts, models, and required files for the Deep Noise Suppression (DNS) Challenge.
Creative Commons Attribution 4.0 International
1.13k stars 415 forks source link

segmental_snr_mixer(), snr is used after rms already changed? #53

Open cookcodes opened 3 years ago

cookcodes commented 3 years ago

in function

def segmental_snr_mixer(params, clean, noise, snr, target_level=-25, clipping_threshold=0.99):

line 165 and on:

clean = normalize_segmental_rms(clean, rms=rmsclean, target_level=target_level)
noise = normalize_segmental_rms(noise, rms=rmsnoise, target_level=target_level)
# Set the noise level for a given SNR
noisescalar = rmsclean / (10**(**snr**/20)) / (rmsnoise+EPS)
noisenewlevel = noise * noisescalar

when use snr, the rms of clean and noise is changed due to clean and noise signals are changed in normalize_segmental_rms(), so why use rmsclean and rmsnoise when calculate noisescalar?

motus commented 3 years ago

Good question @cookcodes - @chandanka90, @hadubey, do you know what's going on there?

stonelazy commented 2 years ago

Have very same question, any pointers to this please ?