diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-12 20:06:23 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-12 20:06:23 +0000 |
| commit | 2a32e498c87ea76a4f2d9b391a6f412afb31834d (patch) | |
| tree | b4ded72cc52c94c42128309e46c9090e97994f6a /util/spkmodem_recv/spkmodem-recv.c | |
| parent | 8ccaff0d8eaffe5548db0d71ffa804c036641194 (diff) | |
useful comments
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/spkmodem_recv/spkmodem-recv.c')
| -rw-r--r-- | util/spkmodem_recv/spkmodem-recv.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index eaf80717..f2b5e78d 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -186,15 +186,22 @@ decode_pulse(struct decoder_state *st) ringpos = st->ringpos; sep_pos = st->sep_pos; + /* + * Moving sum of the last N + * pulses; O(1) per sample. + */ old_ring = st->pulse[ringpos]; old_sep = st->pulse[sep_pos]; - st->freq_data -= old_ring; st->freq_data += old_sep; st->freq_separator -= old_sep; sample = read_sample(st); + /* + * Noise suppression, with a frequency + * tolerancy defined by THRESHOLD. + */ if ((unsigned)(sample + THRESHOLD) > (unsigned)(2 * THRESHOLD)) new_pulse = 1; |
