signal_unit
Builtin index · Signal processing
signal_unit(s, [unit])
Input: s, unit · Output: no output
What it is
Added in v0.2.4. With one argument, reads the sample unit (Nothing if unset). With two, stamps one without touching a sample — the caller asserting what the numbers already are, which is the only way a raw capture acquires a unit. Stamping is not converting; convert_unit is the one that rescales. An unknown unit is refused with the full known list.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
signal_unit(s, [unit]) | s —not documented yetunit optionalWith one argument, reads the sample unit (Nothing if unset). | not documented yet | Added in v0.2.4. Stamping is not converting; convert_unit is the one that rescales. |
Examples
No documentation example calls this form yet. The Signal processing chapter is where one belongs.
How it works
signal_unit(s) READS the sample unit; signal_unit(s, "V") STAMPS one, without touching a sample. Stamping is not converting. It is the caller asserting what the numbers already are, which is the only way a raw capture ever acquires a unit in the first place. convert_unit is the one that rescales; keeping them separate means neither can be mistaken for the other.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.