mcandre / rouge

a work in progress BPSK modem
Other
9 stars 1 forks source link

handle short peak-valley transitions better #2

Open mcandre opened 4 years ago

mcandre commented 4 years ago

Take into account extreme pivots from really high samples to really low samples, or vice versa. This is common in test tracks. When you're unlucky, the sampler omits the middle zero value and reports something like 3718, -4295.

This gets particularly problematic as the peak amplitude shrinks closer to zero. It becomes difficult to determine PO-32 data from line noise.

From Calculus, we know that the analog signal hits zero between these samples. It's just that the sample rate isn't infinite and so PCM data is pretty much guaranteed to omit the near-zero points in the middle.

When we see a change in sign, we can satisfy the hunt for an inner threshold / lull / beginning of a peak or valley, and have the cursor seek to the top of the next valid peak or valley.

This enhancement provides more reliability for signal decoding, and can aid in recovering some corrupt PO-32 backups.

Regards https://github.com/mcandre/rouge/issues/1