Qu

to_unit

Builtin index · Signal processing

to_unit(s, unit)

Input: s, unit · Output: no output

What it is

Added in v0.2.4. Alias of convert_unit(s, unit) above — the spec's own second spelling, kept so a reader following toolkit-signal.md §10 literally finds it.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
to_unit(s, unit)
s —not documented yet
unit —not documented yet
not documented yetAdded in v0.2.4.

Examples

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

How it works

convert_unit(s, "mV") / to_unit(s, "mV") -- rescale the SAMPLES into another unit of the same physical quantity and move the unit tag with them, so the two can never disagree. Refuses across families (V -> Pa) by naming both. That is the §1 "mismatched rates error, they never silently reinterpret" rule applied to the vertical axis: volts to pascals is a CALIBRATION, it needs a transducer sensitivity, and answering it with a scale factor would be inventing one.

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