verify_signal
Builtin index · Signal processing
result = verify_signal(x)
Input: x · Output: result
What it is
x: a real vector, Mat or Signal. Structural sanity before any of the semantic diagnostics above is worth running — deliberately narrow: it answers "are these samples a usable record", not "is this signal any good".
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = verify_signal(x) | x vector, Mat, or Signalnot documented yet | n Numa Num, sample countinf NumNums, counts — called out separately because a single NaN makes a mean, an FFT or a filter return NaN *throughout*, not just at that positionfinite —a Boolconstant —a Bool, every sample equal — reported, but not an error: a DC measurement is a real thing and a stuck channel is the caller's judgementok —a Boolissues List or stringa List of strings naming what is wrong, empty when okduration NumNums | Returns a Record with fields n (a Num, sample count), nan, inf (Nums, counts — called out separately because a single NaN makes a mean, an FFT or a filter return NaN *throughout*, not just at that position), finite (a Bool), constant (a Bool, every sample equal — reported, but not an error: a DC measurement is a real thing and a stuck channel is the caller's judgement), ok (a Bool) and issues (a List of strings naming what is wrong, empty when ok). Given a Signal, two more fields — rate and duration (Nums) — and a rate that is zero, negative or non-finite becomes an issue, since every frequency axis derived from it would be meaningless. Named verify_signal rather than verify because a bare verify says nothing about what it verifies. |
Examples
No documentation example calls this form yet. The Signal processing chapter is where one belongs.
How it works
verify_signal(x) -- structural sanity before any semantic diagnostic above is worth running. Named verify_signal rather than verify because a bare verify says nothing about what it verifies, and this engine already has file- and hash-shaped things that would want the name. Deliberately narrow: it answers "are these samples a usable record", not "is this signal any good". NaN is called out separately from infinity because they fail differently -- a single NaN makes a mean, an FFT or a filter return NaN THROUGHOUT, not just at that position, which is how one bad sample becomes a whole bad analysis with nothing to show for it. A constant record is reported as constant and is NOT an error: a DC measurement is a real thing, and a stuck channel is for the caller to judge. Given a Signal, the sample rate is checked too and the implied duration reported, since a rate of zero or NaN silently poisons every frequency axis derived from it.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.