# Psychoacoustic Clipper

## Functionality

The Psychoacoustic Clipper clips the signal while avoiding sizzling or crackling distortion. The end result sounds somewhere between a limiter and a normal clipper.
The clipper uses block-based FFT filtering to remove distortion that isn't masked by the sounds in the input. Because the filtering introduces overshoots, the clipper repeats the clipping-filtering process a few times to achieve peak level control.

## Theory

Sometimes clipping sounds fine. Sometimes it sounds horrible. The difference is in the spectral content of the sound being clipped. Sounds that have sparse spectral content (i.e. solo piano or vocal) can expose even just a little bit of clipping. Sounds that have dense spectral content (i.e. snare drum) tend to hide clipping distortion well.
The psy-clipper compares the spectrum of the input and the spectrum of the distortion, and removes the part of the distortion that would "stick out". Example with piano:

original | normal clipper | psy-clipper

## Controls

- Input (knob): Raise the volume before the signal is sent to the clipper.
- Input L/R (VU-meter): The level of the original signal
- 0dB (LED): Flashes if the level of the original signal raises above 0dB (it doesn't clip your signal)
- Output L/R (VU-meter): The level of the compressed and made up signal
- 0dB (LED): Flashes if the level of the output signal raises above 0dB (it may clip your signal depending on your host and your systems' bitrate!)
- Output (knob): Raise the overall volume after the compression stage
- Bypass: Don't process anything, just bypass the signal
- Auto-level: If enabled, scales the output signal to 0 dBFS, effectively applying a gain equal to the inverse of the limit setting - adding back the removed amplitude in the process.
- Clip Level: The level to clip the input signal at.
- Hear Difference: If enabled, the output will contain only the difference between the input signal and the clipped signal (the distortion introduced by the clipper).
- Iterations: How many times the clipping-filtering process should be repeated for each block. Higher settings can improve quality but also increase CPU usage.
- Adaptive Distortion: How easily the clipper gives up distortion control to reach the peak level target. With a high number of iterations, the adaptive distortion can be reduced without losing peak control. Conversely, with a low number of iterations, the adaptive distortion must be increased to avoid overshoots.
- Protection Margin: Sets how many dB the distortion should be kept below the signal. Note that Adaptive Distortion will reduce the protection margin based on the remaining peak level to achieve peak control. Increasing the margin of a band can cause Adaptive Distortion to work harder and reduce the margin of other bands.
- Protection Margin Reduction: Shows the effect of Adaptive Distortion. The margin adjustment is applied equally to all frequencies.