mcandre / rouge

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

auto-select amplitude bounds #1

Open mcandre opened 4 years ago

mcandre commented 4 years ago

Currently, users have to guess and check different values for the inner and outer sine wave boundaries. That makes rouge easy to program, but hard to use.

Let's come up with a better way to fit samples onto a sine wave, automatically identifying when each peak/valley starts and ends.

One simple implementation would slice the samples into fixed time increments. This likely introduces drift and may not be viable.

If we ran some tests and identified the worst but still functional PO-32 Tonic backup recording parameters:

That would inform a greatest lower bound on the inner threshold and a least upper bound on the outer threshold, relative to bit depth.

We could apply this setting generally and avoid requiring the user to input an inner threshold value. The difference between line noise and the start of a PO-32 Tonic backup signal would be... whatever the real PO-32 Tonic deems acceptable.

Then, we could replace the fixed outer bound with a differential marker: Regardless of what the user might try for specifying an outer threshold, a peak would simply consist of a point in time where current sample magnitude reduces from the magnitude of the previous sample. Like this:

~~~