fix ulaw2lin()
This commit is contained in:
parent
2aba2a9c49
commit
4cf2b2705a
1 changed files with 3 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue