seungwonpark / melgan

MelGAN vocoder (compatible with NVIDIA/tacotron2)
http://swpark.me/melgan/
BSD 3-Clause "New" or "Revised" License
637 stars 116 forks source link

mel_fmax does not cover all frequency #7

Closed seungwonpark closed 5 years ago

seungwonpark commented 5 years ago

Looks like waveglow's default configuration doesn't allow mel-spectrogram to represent all range of frequency (0~11025Hz): https://github.com/NVIDIA/waveglow/blob/master/config.json

This is a plot of librosa.filters.mel(22050, 1024, 80, fmin=0.0, fmax=8000.0).

image

I think was the reason why waveglow and our implementation of melgan doesn't look to generate high-frequency audio.

seungwonpark commented 5 years ago

Running another experiment by setting mel_fmax=11025.0. I had to run preprocess.py again since all mel-spectrograms need to be calculated again.

rishikksh20 commented 5 years ago

@seungwonpark Actually this is how vocoder works efficiently, we always consider frequency between 0 to 8000 from wavenet to wavernn all vocoder models in between this frequency range, this helps model to consider vocal frequency (bandwidth allocated for a single voice-frequency transmission channel is usually 4 kHz) over other frequencies. Per the Nyquist–Shannon sampling theorem, the sampling frequency (8 kHz) must be at least twice the highest component of the voice frequency via appropriate filtering prior to sampling at discrete times (4 kHz) for effective reconstruction of the voice signal. So 8kHz is enough to model any voice. Meanwhile we do lose some environmental crispness by doing this, but you only notice a minute difference when you heard sound with Good noise cancellation headphone.

seungwonpark commented 5 years ago

@rishikksh20 Thanks for sharing your insight! I will be doing an ablation study on this, but I think we can close this issue for now since it's not really critical, as you've explained.