You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adc: replace NaNs before converting array to integers.
When converting physical to digital sample arrays, we must replace NaN
values (which represent a missing sample) with the appropriate
invalid-sample sentinel value.
Attempting to convert a floating-point NaN to an integer, as was done
here, is implementation-defined behavior (and is controlled, to an
extent, by the global numpy configuration.) We don't want to be
dependent on the hardware or the global numpy configuration, and for
efficiency it's best to avoid triggering floating-point errors to
begin with.
So instead of converting the floating-point array to integers, and
fixing up the integer array after the fact, we want to replace the
floating-point values *first*, and then convert to integers.
0 commit comments