Files
lbmk/util/spkmodem_decode
Leah Rowe e8d46de0e1 util/spkmodem-decode: also auto-detect separator
the tone detection currently only tracks data, not
the separator. track both instead, for improved
detection reliability.

e.g.

separator tone e.g: 9
data low tone e.g: 18
data high tone e.g: 24

two fir windows produce e.g.
freq data 9 sep 0
then 18, 9
then 24, 9
18, 9

so we take min(data, separator)

that gives 9,9,9,9

now we have the separator cluster

however, if both windows are active during transitions,
you can also capture the higher clusters, which would
allow freq_max to grow

so when you learn e.g.:

freq min = 9
freq max 24

then the learned threshold would be:

(9 + 24) / 2 = 16

and now you know how to separate the tones

fir already suppresses noise so the pulse should
be reliable. so freq/sep only go non-zero when an
actual tone exists

this should now result in being able to sync with
spkmodem encoders with no prior knowledge of the
correct tone frequences. we just use maths.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-26 06:58:19 +00:00
..