True Peak Limiting / Soft Clipper
Hi! Glad to be back learning Max again.
I have a question: how can I make a true peak limiter, or clipper?
So far all I understood is that first I need to oversample using [poly~ oversampling 1 up 4].
Maybe someone can give me a hint? Thanks!
as i do not know the exact formula of the auto antialiasing in poly~ (and prefer selfmade bugs over factory content bugs) (...but maybe it does the same?) the upsampling should be done like that:
- zeropadding (each input sample value followed by 0., 0., 0.)
- 3rd oder butterworth (aka 18db) @nyquist of input rate
the rest is simple: measure the peak of the upsampled signal, this is the TP value.
note that most audiointerfaces use at least x16 oversampling, the x4 for the TP measurement is only the minimum suggestion/ITU standard.
i believe it is fine to make it dynamic and use x4 for >=88khz and x8 for 44khz.
this is for PCM with DAC only. mpeg decoding required far more and to my knowledge can not be predicted.
Oversampling is definitely the right start, I’ve had good results combining it with a soft clipper curve instead of a hard cutoff. Keeps things transparent while still taming the peaks nicely.
(forgot one thing... just to be clear... you of course apply the dynamics effect to the input signal, not to the one you used for measuring TP.)