Skip to content
Snippets Groups Projects
Commit a716ea6d authored by Florent Jaillet's avatar Florent Jaillet
Browse files

Correct Waveform.astype()

parent 98a31c03
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -757,7 +757,8 @@ 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 = (super().astype(np.float64) - zero) / (int_range // 2)
y = ((super(type(y), y).astype(np.float64) - zero)
/ (int_range // 2))
y.clip(min_value=-1, max_value=1-np.finfo(dtype).eps)
y = y.astype(dtype)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment