util/spkmodem-recv: make new pulse calculation clearer

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-12 04:59:42 +00:00
parent 62a496ec9e
commit 2c3d0b5a3e
+4 -4
View File
@@ -153,6 +153,7 @@ decode_pulse(struct decoder_state *st)
{
size_t n;
unsigned char old_ring, old_sep;
unsigned char new_pulse;
old_ring = st->pulse[st->ringpos];
old_sep = st->pulse[st->sep_pos];
@@ -168,10 +169,9 @@ decode_pulse(struct decoder_state *st)
err(errno, "stdin read");
}
st->pulse[st->ringpos] =
abs(st->frame[st->ringpos]) > THRESHOLD;
st->freq_separator += st->pulse[st->ringpos];
new_pulse = abs(st->frame[st->ringpos]) > THRESHOLD;
st->pulse[st->ringpos] = new_pulse;
st->freq_separator += new_pulse;
st->ringpos++;
if (st->ringpos >= MAX_SAMPLES)