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

Problem with "magnitude" mode #21

Closed hangtingchen closed 5 years ago

hangtingchen commented 5 years ago

Hi Yong Xu, I have read your code and meet some problem of the "magnitude" mode in func calc_sp

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

The operation "astype" just throws away the imag part of a complex, which i have tested under numpy 1.13.3. Use np.abs to take magnitude. Is this a bug or something else ?

qiuqiangkong commented 5 years ago

Hi,

if the mode is set as 'magnitude', then the x obtained from [f, t, x] = signal.spectral.spectrogram is np.float64, not complex type. Then the x = x.astype(np.float32) is only used to reduce the disk usage to save the features.

Best wishes,

Qiuqiang


From: hangtingchen notifications@github.com Sent: 10 December 2018 11:36:26 To: yongxuUSTC/sednn Cc: Subscribed Subject: [yongxuUSTC/sednn] Problem with "magnitude" mode (#21)

Hi Yong Xu, I have read your code and meet some problem of the "magnitude" mode in func calc_sp

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

The operation "astype" just throws away the imag part of a complex, which i have tested under numpy 1.13.3. Use np.abs to take magnitude. Is this a bug or something else ?

— 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/21, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMt5ycbXV5kPRuWssZBMzjHPa7V3LsJ_ks5u3kc6gaJpZM4ZLL06.

hangtingchen commented 5 years ago

got it, thanks a lot