yongxuUSTC / sednn

deep learning based speech enhancement using keras or pytorch, make it easy to use
http://staff.ustc.edu.cn/~jundu/The%20team/yongxu/demo/SE_DNN_taslp.html
334 stars 125 forks source link

Wrong noise trunication? #23

Closed DinoTheDinosaur closed 5 years ago

DinoTheDinosaur commented 5 years ago

In _preparedata.py in _calculate_mixturefeatures

# Truncate noise to the same length as speech. 
else:
    noise_audio = noise_audio[noise_onset : noise_offset]

Shouldn't the range here be noise_audio[:len(speech_audio)] for instance? Otherwise it results in shapes mismatch later in the code.

qiuqiangkong commented 5 years ago

Hi, could you point out which line is the code? Many thanks!

Best wishes,

Qiuqiang


From: DinoTheDinosaur notifications@github.com Sent: 29 December 2018 03:28:45 To: yongxuUSTC/sednn Cc: Subscribed Subject: [yongxuUSTC/sednn] Wrong noise trunication? (#23)

Truncate noise to the same length as speech.

else: noise_audio = noise_audio[noise_onset : noise_offset]

Shouldn't the range here be noise_audio[:len(speech_audio)] for instance? Otherwise it results in shapes mismatch later in the code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/yongxuUSTC/sednn/issues/23, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMt5yXGhSeDSCK_8r0msO622BxLtaBbrks5u9uFtgaJpZM4ZkY3c.

DinoTheDinosaur commented 5 years ago

Here

qiuqiangkong commented 5 years ago

The usage of noise_onset and noise_offset is that the mixing depends on the .csv file. So you may check out the .csv file to see how is the noise added to the speech.

If we use noise_audio[:len(speech_audio)] then only the begining part of the noise is used. There will not be shapes mismatch as onset_noise and offset_noise in the .csv is already pre-calculated to ensure the shape is correct.


From: DinoTheDinosaur notifications@github.com Sent: 06 January 2019 08:19:11 To: yongxuUSTC/sednn Cc: Kong, Qiuqiang (PG/R - Elec Electronic Eng); Comment Subject: Re: [yongxuUSTC/sednn] Wrong noise trunication? (#23)

https://github.com/yongxuUSTC/sednn/blob/c7efa60200f53f7b6653abb7051f6b39cbbc413b/mixture2clean_dnn/prepare_data.py#L158

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/yongxuUSTC/sednn/issues/23#issuecomment-451723949, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMt5yaAj74McJqJaL5MTjLseuyTIVh8oks5vAbF_gaJpZM4ZkY3c.

DinoTheDinosaur commented 5 years ago

Yes, you're right, I see it in the code now.

Strangely, this part threw an error before the adjustments... Maybe there are some environment issues (I work in python 3). I guess I will look into the problem in detail some other time, closing the issue for now