Qu

find_clipping

Builtin index · Signal processing

result = find_clipping(x, [threshold=], [full_scale=], [tol=], [min_run=3])

Input: x, threshold, full_scale, tol, min_run · Output: result

What it is

Same detection as is_clipped, same keywords, but returns *where*.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = find_clipping(x, [threshold=], [full_scale=], [tol=], [min_run=3])
x —not documented yet
threshold Model, Num, or Vec, optionalReturns a Model of kind "find_clipping" (the named-field multi-return findpeaks/qr/svd already use, since Qu has no tuple unpacking) with fields count (a Num, how many runs), starts, ends (Vecs of run bounds, inclusive at both ends like every Qu range), lengths (a Vec), values (a Vec, the level each run is held at — signed, so the positive rail is distinguishable from the negative one), samples (a Num, total samples inside runs), fraction (a Num, samples / N), and threshold, tol, min_run (Nums, echoing back the parameters actually used — when the threshold was inferred, a caller reading only starts has no way to know what level the answer is relative to).
full_scale optionalnot documented yet
tol Model, Num, or Vec, optionalReturns a Model of kind "find_clipping" (the named-field multi-return findpeaks/qr/svd already use, since Qu has no tuple unpacking) with fields count (a Num, how many runs), starts, ends (Vecs of run bounds, inclusive at both ends like every Qu range), lengths (a Vec), values (a Vec, the level each run is held at — signed, so the positive rail is distinguishable from the negative one), samples (a Num, total samples inside runs), fraction (a Num, samples / N), and threshold, tol, min_run (Nums, echoing back the parameters actually used — when the threshold was inferred, a caller reading only starts has no way to know what level the answer is relative to).
min_run Model, Num, or Vec, optional (default 3)Returns a Model of kind "find_clipping" (the named-field multi-return findpeaks/qr/svd already use, since Qu has no tuple unpacking) with fields count (a Num, how many runs), starts, ends (Vecs of run bounds, inclusive at both ends like every Qu range), lengths (a Vec), values (a Vec, the level each run is held at — signed, so the positive rail is distinguishable from the negative one), samples (a Num, total samples inside runs), fraction (a Num, samples / N), and threshold, tol, min_run (Nums, echoing back the parameters actually used — when the threshold was inferred, a caller reading only starts has no way to know what level the answer is relative to).
count Numa Num, how many runs
ends VecVecs of run bounds, inclusive at both ends like every Qu range
lengths Veca Vec
values Veca Vec, the level each run is held at — signed, so the positive rail is distinguishable from the negative one
samples Numa Num, total samples inside runs
fraction Numa Num, samples / N
min_run NumNums, echoing back the parameters actually used — when the threshold was inferred, a caller reading only starts has no way to know what level the answer is relative to
Returns a Model of kind "find_clipping" (the named-field multi-return findpeaks/qr/svd already use, since Qu has no tuple unpacking) with fields count (a Num, how many runs), starts, ends (Vecs of run bounds, inclusive at both ends like every Qu range), lengths (a Vec), values (a Vec, the level each run is held at — signed, so the positive rail is distinguishable from the negative one), samples (a Num, total samples inside runs), fraction (a Num, samples / N), and threshold, tol, min_run (Nums, echoing back the parameters actually used — when the threshold was inferred, a caller reading only starts has no way to know what level the answer is relative to).

Examples

No documentation example calls this form yet. The Signal processing chapter is where one belongs.

How it works

Returns a Value::Model, the named-field multi-return this engine already uses for findpeaks/qr/svd -- Qu has no tuple unpacking, and clipping is never one number. threshold/tol/min_run are echoed back on purpose: when the threshold was inferred from the record, a caller reading only starts has no way to know what level the answer is relative to.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.