apply_gain
Builtin index · Signal processing
apply_gain(s, g)
Input: s, g · Output: no output
What it is
Added in v0.2.4. Multiplies every sample by a linear gain factor and composes it into the calibration record, so a calibrated signal stays calibrated and its level rises accordingly. gain(x, db) is the decibel spelling of the same operation and the two agree exactly; both exist because both are idiomatic, and the names say which is which.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
apply_gain(s, g) | s —not documented yetg —not documented yet | not documented yet | Added in v0.2.4. Multiplies every sample by a linear gain factor and composes it into the calibration record, so a calibrated signal stays calibrated and its level rises accordingly. gain(x, db) is the decibel spelling of the same operation and the two agree exactly; both exist because both are idiomatic, and the names say which is which. |
Examples
No documentation example calls this form yet. The Signal processing chapter is where one belongs.
How it works
apply_gain(s, g) -- a LINEAR gain factor, not decibels. gain(x, db) is the decibel spelling and keeps its name; both exist because both are idiomatic in their own half of the field, and the names say which is which rather than one name taking a unit keyword nobody remembers to pass.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.