measure: the split's own means are back as above/below/between
`top`, `bottom` and `amplitude` became the *flat levels* in e83ad86 -- the level the
signal dwells at, read from the density of the window's buckets -- and that change kept
the split's own two means as its internal fallback for a window the pyramid cannot
summarize. Those means are now three types of their own, so the two different questions
about one split can be asked side by side: `above %` and `below %` are the plain mean of
the samples on one side of a share -- the reading the old `top`/`bottom` gave -- and
`between % %` is the mean of the band between two shares, which no single split can
answer, because a band's two edges are two thresholds.
Nothing about the arithmetic is new, and nothing is a new pass. `Above`/`Below` are the
`sum[]`/`count[]` split `measure_accumulate()` already folds -- the very figures
`Top`/`Bottom` fall back to -- and `Between` is the **difference of two levels' upper
sides**, both of which come out of one pass two over one window. It rides the bucket
fast path unchanged: a bucket wholly inside the band is strictly above the lower level
and strictly below the upper one, so both accumulators fold it whole, and only the
buckets that straddle either edge are opened. `measure_level_pcts()` is the one place the
shares are read, and it clamps both and puts `between`'s pair **in order**, so "between
80 % and 20 %" is the band between 20 % and 80 % -- normalized rather than refused,
because the shares name two edges rather than a direction. Nothing to measure reads `--`,
as for every other type: a share at 100 % has no sample above it, and a band can hold
none at all.
Measured, `[bandavg-probe]`, fast mock at a 2 s window (`--rate 1300000 --batch 1000
--freq 1`):
sine `above 50` 0.636620 (2/pi), `below 50` -0.636620, `between 50 75` 0.255873
square `above 50` 0.986496 (30 harmonics) / 1.000000 (--square-harmonics 0),
`between 50 75` 0.302744 / --
ramp `between 50 75` 0.250000 and `above 50` 0.500000, `above 100` --
The first three are the figures the old `top`/`bottom` documented; the ramp's are what a
uniform density predicts (a band's mean is its own centre); the ideal square's empty band
is the nothing-to-measure rule. The pane offers the types and edits their percentages
through the dialog's second share -- which only `between` shows -- and a measurement's
pair survives add/edit/delete and the session file (`threshold2`), where a file written
before it existed loads at the default.
No raw pass: with the measurements probe adding one of every type at a 2 s window, `raw`
went from 113966 of 240719031 covered (0.0%) to 134978 of 255372033 (0.1%), 0.8 -> 1.1
ns a covered sample.
Docs: the band-average invariant (and the two assertions the flat-level change moved),
the probe readings for the new probe, the verification recipe, the manual's measurements
page and the README.
This commit is contained in:
1 parent
e83ad86b8f
commit
22e7a8efcc
14 files changed
+769
-98
No files matched your search
@@ -26,8 +26,8 @@
|
||||
</item>
|
||||
<item>
|
||||
<p>The pane's <gui>+</gui> adds one; clicking a row opens the dialog where the signal,
|
||||
the type, the threshold share and the on-plot marks are set, with <gui>Save</gui> and
|
||||
<gui>Delete</gui>.</p>
|
||||
the type, the threshold share or shares and the on-plot marks are set, with
|
||||
<gui>Save</gui> and <gui>Delete</gui>.</p>
|
||||
</item>
|
||||
</steps>
|
||||
</section>
|
||||
@@ -35,14 +35,32 @@
|
||||
<section id="knowing">
|
||||
<title>Worth knowing</title>
|
||||
<list>
|
||||
<item><p>The types are average, top, bottom, min, max, peak to peak, amplitude, pulse
|
||||
duration, period and frequency. <gui>top</gui> and <gui>bottom</gui> are the waveform's
|
||||
<item><p>The types are average, top, bottom, min, max, peak to peak, amplitude, above,
|
||||
below, between, pulse duration, period and frequency. <gui>top</gui> and <gui>bottom</gui> are the waveform's
|
||||
<em>flat</em> high and low levels: the level the signal dwells at, taken from the densest
|
||||
band of the window on each side of the split. A band-limited edge overshoots and rings —
|
||||
a nominal 2 V square reaches about ±1.18 at its edges — and a ripple or an overshoot is
|
||||
therefore <em>not</em> what these read. <gui>amplitude</gui> is the delta between those two
|
||||
levels, and <gui>peak to peak</gui> is the swing between the extremes (so on a rippled
|
||||
square <gui>amplitude</gui> reads 2 V where <gui>peak to peak</gui> reads 2.36 V).</p></item>
|
||||
<item><p><gui>above</gui>, <gui>below</gui> and <gui>between</gui> are the opposite kind of
|
||||
number: the plain <em>mean of the samples</em> above a share, below it, or between two
|
||||
shares. That is a different question from <gui>top</gui>/<gui>bottom</gui> even about the
|
||||
same split, and it is the older one — on a unit sine <gui>above 50%</gui> reads 0.64 V
|
||||
(2/π, the mean of a half cycle) where <gui>top</gui> reads 0.96 V (near the peak, which is
|
||||
where a sine dwells most), and on a band-limited square <gui>above 50%</gui> reads 0.99 V
|
||||
where <gui>top</gui> reads the plateau, 1.00 V: the edge's ring is inside the first and not
|
||||
inside the second. <gui>between</gui> takes <em>two</em> shares — <gui>from %</gui> and
|
||||
<gui>to %</gui> — and reports the mean of the samples inside that band, which no single
|
||||
split can answer; the order you type them in does not matter, since a band between 80 % and
|
||||
20 % is the band between 20 % and 80 %.</p></item>
|
||||
<item><p>A mean over a side carries whatever is on that side, so these three are the right
|
||||
numbers when you want the <em>energy</em> or the <em>offset</em> of part of the waveform,
|
||||
and the wrong ones when you want the level a plateau sits at. Like every other measurement,
|
||||
one with nothing to measure reads <code>--</code> rather than a made-up number: a share at
|
||||
100 % has no sample above it, and a band can hold none at all — on an ideal
|
||||
(non-ringing) square every sample is exactly ±1, so a band between 50 % and 75 % is
|
||||
empty.</p></item>
|
||||
<item><p><gui>top</gui> and <gui>bottom</gui> also read <em>near the peak</em> on a
|
||||
waveform that has no flat part, which is the honest reading rather than a failure: a unit
|
||||
sine has no plateau, so the densest band is at its peak and these read about ±0.96 — not
|
||||
@@ -95,7 +113,9 @@
|
||||
not the raw window: a bucket's sum is a sum, so the mean, the extremes and a level's own
|
||||
mean are exact. <gui>top</gui>, <gui>bottom</gui> and <gui>amplitude</gui> read the
|
||||
<em>density</em> of the window out of that same summary — which is what tells a flat level
|
||||
from a ripple — so those three cost a second read of the summary and never of a sample.</p></item>
|
||||
from a ripple — so those three cost a second read of the summary and never of a sample, and
|
||||
<gui>between</gui>'s second share is one more level in the same summary walk rather than a
|
||||
walk of its own.</p></item>
|
||||
<item><p><gui>Statistics</gui> adds a second line to every measurement showing
|
||||
<code>n</code>, the mean, the standard deviation and the range. Each observation is one
|
||||
<em>recompute</em> of the pane, so <code>n</code> counts windows measured, not samples —
|
||||
@@ -117,6 +137,13 @@
|
||||
<code>bottom=-0.999983</code>, <code>amplitude=1.999966</code> against
|
||||
<code>peak to peak=2.358701</code> — the levels are the plateau's and the extremes are the
|
||||
edges'. Over a 2 M-sample window those passes read about 0.1% of the samples.</p>
|
||||
<p>The mean-over-a-side types on the same two windows: on the sine
|
||||
<code>above 50=0.636620</code>, <code>below 50=-0.636620</code> and
|
||||
<code>between 50 75=0.255873</code>; on the rippled square <code>above 50=0.986496</code> and
|
||||
<code>between 50 75=0.302744</code>, against <code>1.000000</code> for the same
|
||||
<code>above 50</code> on an ideal (non-ringing) square. A <code>ramp</code>, whose density is
|
||||
uniform, is the shape that names what a band mean <em>is</em>: <code>above 50=0.500000</code>
|
||||
and <code>between 50 75=0.250000</code>, each band's own centre.</p>
|
||||
</section>
|
||||
|
||||
</page>
|
||||
Reference in new issue
Block a user