Fix LO generator

This commit is contained in:
Jan Hamal Dvořák 2025-07-03 12:46:38 +02:00
parent 8a6283c5ae
commit af75d81ce5

View file

@ -287,13 +287,13 @@ static void lo_generate(uint32_t *buf, size_t len, double freq, unsigned phase)
unsigned bits = 0;
for (int j = 0; j < 32; j++) {
bits <<= 1;
#if LO_DITHER
int noise = (rnd_next() >> 3) - (rnd_next() >> 3);
bits |= (accum + noise) >> 31;
#else
bits |= accum >> 31;
#endif
bits <<= 1;
accum += step;
}