fix ulaw2lin()

pull/8/head
Jean-Marc Valin 2018-07-29 01:41:18 -04:00
parent f94e6304e3
commit 3e4d9878de
No known key found for this signature in database
GPG Key ID: 5E5DD9A36F9189C8
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,9 @@ import numpy as np
import math
def ulaw2lin(u):
return (math.exp(u/128*math.log(256))-1)/255
s = np.sign(u)
u = np.abs(u)
return s*(np.exp(u/128*math.log(256))-1)/255
def lin2ulaw(x):