Bugfix: exportAsWave() normalization failed when dtypes of data and maxabs were different

This commit is contained in:
Casper Jansen 2022-10-13 12:06:51 +02:00
parent 0d6d72fb35
commit 4db90e3885

View File

@ -654,7 +654,7 @@ class Measurement:
if normalize: if normalize:
# Scale back to maximum of absolute value # Scale back to maximum of absolute value
maxabs = np.max(np.abs(data)) maxabs = np.max(np.abs(data))
data /= maxabs data = data / maxabs # "data /= maxabs" fails if dtpyes differ
if newsampwidth is not None: if newsampwidth is not None:
# Convert to floats, then to new sample width # Convert to floats, then to new sample width