Gain
MathThe Gain block multiplies its input signal by a constant gain factor (K). This is one of the most fundamental and commonly used blocks in signal processing and control systems. It provides simple scaling of signals without changing their fundamental characteristics.
The block has one input port and one output port, making it straightforward to integrate into signal chains. Common applications include proportional gain in controllers, signal amplification, and unit conversion.
Mathematical Model
The Gain block implements a simple multiplication operation:
Where:
output(t)is the output signal at time tKis the gain factor (configurable parameter)input(t)is the input signal at time t
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | in |
Input | number | Required |
| ← Out | out |
Output | number | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
gain |
Gain (K) | number | 1 |
Multiplication factor for the input signal |
Usage Examples
Signal Inversion
Invert a sine wave signal:
SignalGenerator → Gain (gain: -1) → Scope
Signal Amplification
Double the output of a sensor:
Sensor → Gain (gain: 2) → NumericDisplayRemarks & Best Practices
- No Internal State: Pure function with no memory - output depends only on current input.
- Linear Operation: Does not introduce distortion or harmonics.
- Computation Cost: Minimal - single multiplication operation per simulation step.
- WASM Powered: Near-native execution speed in the browser.
Related Components
- Sum: Add multiple signals together
- Constant: Provide fixed values for gain scaling
- NumericDisplay: View the result in real-time