I want to normalize the result of the read function in wave package in Python. I thought, it should be done by dividing it by 32767. But when I compare the result with the results from MATLAB, dividing it by 32768, gives a better result. So ideally, should it be divided by 32768?
Python code:
a = read('male 1.wav')
data = np.array(a[1],dtype=float)
dataDivide32768 = data/32768
dataDivide32767 = data/32767
print(dataDivide32768)
print(dataDivide32767)
Result:
dataDivide32768:
[ -3.05175781e-05 6.10351562e-05 9.15527344e-05 ..., ]
dataDivide32767:
[ -3.05185095e-05 6.10370190e-05 9.15555284e-05 ..., ]
MATLAB code:
filename = 'male 1.wav';
[y,Fs] = wavread(filename);
Result:
[-3.05175781250000e-05 6.10351562500000e-05 9.15527343750000e-05 ...]