Commit 6db09b6
Benjamin Moody
Record.adc: round samples rather than truncating.
When converting physical to digital values, the input values are
floating-point and therefore may have rounding errors. We want to
round each value to the nearest integer before calling istype, in
order to avoid adding a bias towards zero.
This applies to adc in all four modes: expanded and not expanded,
in-place and not-in-place.
("In-place" here means both that we can overwrite the original
floating-point arrays, and that the record attributes will be updated
afterwards. In "not-in-place" mode, we are operating on copies of the
original arrays.)1 parent 6437ed3 commit 6db09b6
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
551 | 552 | | |
552 | 553 | | |
553 | 554 | | |
| |||
558 | 559 | | |
559 | 560 | | |
560 | 561 | | |
| 562 | + | |
561 | 563 | | |
562 | 564 | | |
563 | 565 | | |
| |||
572 | 574 | | |
573 | 575 | | |
574 | 576 | | |
| 577 | + | |
575 | 578 | | |
576 | 579 | | |
577 | 580 | | |
| |||
582 | 585 | | |
583 | 586 | | |
584 | 587 | | |
| 588 | + | |
585 | 589 | | |
586 | 590 | | |
587 | 591 | | |
| |||
0 commit comments