bshall / UniversalVocoding

A PyTorch implementation of "Robust Universal Neural Vocoding"
https://bshall.github.io/UniversalVocoding/
MIT License
237 stars 41 forks source link

mulaw encdoing #8

Open maximilianchen opened 5 years ago

maximilianchen commented 5 years ago

Hi bshall,

I have doubt about the mu-law encoding function. I wondered why the function mulaw_encode() returns np.floor((fx + 1) / 2 * mu + 0.5) instead of fx directly.

bshall commented 5 years ago

Hi @maximilianchen,

Sorry about the delay. If you look at the definition on wikipedia you'll see that the range of fx is between -1 and 1. So what we are actually doing is mu-law encoding and then quantizing the result. That's where the next step comes from. I hope that helps.