Fix gain rounding
This commit is contained in:
parent
cb47fd3aa5
commit
e8ca805b5a
|
@ -543,6 +543,7 @@ static void rf_rx(void)
|
|||
int64_t Q = sQ;
|
||||
|
||||
I *= gain;
|
||||
I -= max_amplitude / 2 + 1;
|
||||
I /= max_amplitude;
|
||||
|
||||
if (I > 127)
|
||||
|
@ -553,6 +554,7 @@ static void rf_rx(void)
|
|||
*blockptr++ = (uint8_t)I + 128;
|
||||
|
||||
Q *= gain;
|
||||
Q -= max_amplitude / 2 + 1;
|
||||
Q /= max_amplitude;
|
||||
|
||||
if (Q > 127)
|
||||
|
|
Loading…
Reference in a new issue