Commit 98a31c03 authored by Ronan Hamon's avatar Ronan Hamon

Update conversion to float in Waveform.astype

parent a6a9ce3b
Pipeline #467 passed with stage
in 1 minute and 4 seconds
......@@ -757,7 +757,7 @@ class Waveform(MadArray):
if np.issubdtype(dtype, np.floating):
int_range = src_iinfo.max - src_iinfo.min + 1
zero = src_iinfo.min + int_range // 2
y = (1.0 * y - zero) / (int_range // 2)
y = (super().astype(np.float64) - zero) / (int_range // 2)
y.clip(min_value=-1, max_value=1-np.finfo(dtype).eps)
y = y.astype(dtype)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment