Remove Limiting

Here’s the idea. I have a clip that has been peak limited to the point of creating mild distortion. I want to un-peak limit it. I want to run Leveler upside down. When you hit this threshold, increase the gain by this much.

The Compressor effect tries to help out by being gentle and smooth. I don’t need that. I need to undo limiting caused by a completely unsophisticated limiter – almost clipper, but not quite that aggressive. I don’t have clipping and Clip Fix actually makes things worse. The original show is still there, but runs into waveform mud as the peaks increase.


A similar question and solution suggested by Steve …

That’s the idea. Even if it doesn’t help, I want to listen to the effect with the filter applied.

Steve’s "reverse the effect " nyquist code here does what it says on the tin: a linear amplification sharply kicks in above a threshold …
Before-after Steve's reverse Nyquist code.png

Maybe exponential amplification above a threshold would give a smoother, but still pointier, waveform ?

There’s a slightly more sophisticated version (as a plug-in) here:
If there is a demand (and if I get time) I may develop this further to support stereo tracks and see if I can make the compression and expansion complementary (the inverse of each other).

I can’t wait to try it for real. I applied it briefly to piano2.wav and it worked, what was the phrase, as on the tin.

I can’t shake the idea I’m opening a technological container of biscuits. “I bags the ones with the pink frosting!”


The point at which the expander kicks in isn’t noticeable with the above (exponential) version of “Peak Processor” …

I’ve used an extreme value (+13) for the purpose of illustration, (so comparable with the graph in my previous post)

Well, it did change the signal and exactly as advertised, but it didn’t help. I’m beginning to think my live capture is a victim of room echoes and resonances that happen to line up with the notes.

Ah, well. Worth a shot… Oddly, some passages benefit from a slight increase in peak compression. The visual of what’s happening to the blue waves and what’s happening to the sound are at odds.

“Wait, it should sound worse when I do that.”


Sorry if I got you excited Koz. It’s theoretically possible to perfectly compensate for soft clipping, but practically it’s near impossible. The main trouble is that “correcting” but being slightly off with either the threshold or the curve will usually make the “corrected” waveform sound a lot worse than the uncorrected waveform. It’s near impossible to match the threshold and the curve accurately enough. On top of that my pug-in has a great intolerance for clipping which you may have noticed.

Not to a UK reader it doesn’t Koz.

The phrase “does what it says on the tin” was (and possibly still is) used by a company called Ronseal for its TV ads in the UK. The products they make are timber treatments and varnishes - not quite so appetising as biccies :slight_smile:


It’s theoretically possible to perfectly compensate for soft clipping, but practically it’s near impossible.

I think I was more fascinated with the apparent serious change in the waveform – definitely as on the tin – but little or no change to the voice. I’m going “what’s wrong with this picture…”

I think we’ve graduated to lowering the client’s expectations rather than trying to raise the quality of the work.


If you experiment with some pure (sine) tones, “Plot Spectrum” gives a good indication of “what’s wrong with this picture”.
Clipping, even soft clipping, produces loads of harmonics, and it’s those that give the distortion it’s characteristic “quality”. If you exactly reverse the soft clipping then those harmonics disappear, but if you’re a bit off they’re still there. Any “aliasing” distortion that may occur with some types of soft clipping will remain even if you do get the correction exactly right.