Clip / Saturation
ShippingclipAmplitude limiting: hard clip, soft clip, or wrap
Signature
Inputs
signalSignalrequired
Outputs
resultSignal
Parameters
| Key | Type | Default | Notes |
|---|---|---|---|
mode | enum | clip | one of: clip, soft_clip, wrap |
min_value | float | -1.0 | |
max_value | float | 1.0 | |
softness | float | 0.5 |
Description
Clip / Saturation constrains the amplitude of a signal to the interval , emulating the bounded output range of physical systems (converters, amplifiers, actuators). It operates element-wise, preserving signal length, sample rate, and the input's physical unit — the output carries the same dimension as the input.
Three mode behaviors are available. `clip` (hard saturation) replaces any sample above max_value with max_value and any below min_value with min_value. `soft_clip` applies a smooth tanh-shaped knee near the limits so the transition into saturation is continuous in its derivative; the softness parameter in controls how gradually the knee engages. `wrap` performs modulo wrapping: values leaving the range re-enter from the opposite bound, mimicking phase accumulators and counter overflow.
The node is stateless — each sample maps through a memoryless nonlinearity with no dependence on neighbors or history. Because saturation is nonlinear, uncertainty does not propagate linearly: samples pinned to a bound have their sensitivity to the input collapse toward zero, so any attached is attenuated in the clipped region and preserved where the signal passes through unaltered.
Units attached to the signal flow through unchanged; min_value and max_value are interpreted in the same unit as the incoming signal.
Mathematics
Examples
Hard saturation of a converter output
Model a DAC that saturates at . With mode = clip, min_value = -1.0, max_value = 1.0, a sine of amplitude is flattened at both rails, producing the characteristic clipped plateaus. Everything within passes through untouched.
Soft-clip guitar-style saturation
Set mode = soft_clip, softness = 0.7 to round the knee. Instead of the abrupt corner of hard clipping, the signal eases into the limits along a tanh curve, adding smooth harmonic content rather than the harsh high-order harmonics of a hard corner.
mode = soft_clip
min_value = -1.0
max_value = 1.0
softness = 0.7Applications
- Modeling saturation and rail limits in amplifiers, DAC/ADC front-ends, and sensor conditioning circuits.
- Actuator constraint enforcement in control-loop simulations, where commanded effort must not exceed physical travel or torque limits.
- Audio waveshaping and overdrive/distortion effects using hard or soft (tanh) clipping.
- Phase and counter wrapping in oscillator and modular-arithmetic pipelines via the `wrap` mode.
Neat
In `soft_clip` mode as `softness` approaches 0 the knee sharpens toward the hard-clip corner, while values near 1 spread the nonlinearity across the entire range — hard clip is effectively the limiting case.
Because saturation zeroes the local slope of the transfer curve at a pinned rail, `clip` acts as a nonlinear uncertainty limiter: it can suppress $\sigma$ growth on samples driven into the bounds.
Known issues
In `wrap` mode a degenerate range where `max_value` equals `min_value` yields a zero-width interval, making the modulo undefined (division by zero) at the boundary.
Hard `clip` introduces a slope discontinuity at each limit; downstream derivative or FFT stages will see spectral artifacts (added harmonics) from the sharp corners.