ngscopeclient / scopehal-apps

ngscopeclient and other client applications for libscopehal.
https://www.ngscopeclient.org/
BSD 3-Clause "New" or "Revised" License
549 stars 84 forks source link

Signal to Noise filter (Measurment/Statistic?) #570

Open 602p opened 1 year ago

602p commented 1 year ago

Currently we have measurements and statistics. Measurements are regular filters with a flag that allows the option of not displaying them directly, but instead displaying their statistics. Statistics are of filters, and each statistic is a scalar that remember some history about the filter they are a statistic of through time. Many measurements are per-cycle of an AC waveform, for example the FrequencyMeasurement. Then min, average, and max frequency for the whole waveform (and some history) can be viewed by looking at the statistics for the FrequencyMeasurement.

However, there's some stuff that's kind of ambiguous. The motivating example is wanting a simple SNR measurement. (More design question ticket text than code!) It's not necessarily well-defined to compute average SNR as (unweighted) sum of cycle-wise SNR measurements. We can calculate SNR of a whole waveform as a filter that outputs a waveform with only one point, but that leads to weird UX since displaying it is pointless (ha ha!) Displaying only it's statistics is also weird UX since min = max = average when there is only one point (ignoring history behavior.) It's also weird since (in my opinion) I don't think of the SNR as it's own waveform to view stats of, but as a stat of the initial waveform.

For reference, here is what I have locally with some hackjob patching, which is my preferred UX: image

azonenberg commented 1 year ago

@602p is can we close this now that SNRFilter is now merged?