1
$\begingroup$

I am making a real-time audio compressor/limiter. I am in little doubt about the delay. What is typical delay times for a compressors or limiters delay/lookahead time?

Most other compressors I see don't give option to adjust it, does that mean its fixed or tied to attack time or something else like RMS window time?

$\endgroup$
1
  • $\begingroup$ My understanding of compressors is that there should be minimal delay. Ideally none, but perhaps 1 sample is needed. Can you give a link for what you intend? $\endgroup$
    – Peter K.
    Commented Dec 6, 2021 at 23:15

2 Answers 2

3
$\begingroup$

What is typical delay times for a compressors or limiters delay/lookahead time?

I don't think there is "typical": it depends a lot on the bandwidth, frequency content and what specifically you care about the most (clean vs fast vs loud).

Standard attack/decay limiters have attack times in 1000s of dB per seconds and decay times of maybe 100 or dB/s. Numbers are faster for high frequency content and lower for low frequency content. Doing full band is tricky and very susceptible to intermodulation. Multi-band limiters are certainly something to consider for this.

Soft-clippers tend to be state-less, i.e. instantaneous.

Look-ahead can help a lot with side-chain limiters and "gentle" clip mitigation. More is better, but at some point you are going to run afoul your latency requirements. A few milliseconds is a good starting point.

$\endgroup$
1
  • $\begingroup$ Thank you, I went with a little under 1ms fixed delay. $\endgroup$
    – Invariant
    Commented Dec 8, 2021 at 2:22
3
$\begingroup$

In another life, maybe about 25 years ago, I did a few simple compressors in DSP code and I did toss in a delay on the audio, which is equivalent to a lookahead on the audio envelope. The delay was adjustable but, if I recall correctly, the default delay time was 4 time constants (maybe 5) of the first-order LPF that was filtering the amplitude of the audio.

In this drawing, it would be the length of the "Attack Phase" The idea was to allow the gain to settle to a stable value before the spike or edge in amplitude in the audio (that causes a gain change) arrives at the gain block.

I've also seen this done for limiters that were using a sliding max rather than a simple first-order LPF to smooth the amplitude.

How are you planning to determine the amplitude envelope of the audio, which is used in the gain adjustment function?

enter image description here

$\endgroup$
2
  • $\begingroup$ After calculating how much dB I want to change the signal with, a simple filter like this: g = (1.0 - k) * g_prev + k * f where k is either the attack or release time parameter and f is from the static curve. $\endgroup$
    – Invariant
    Commented Dec 7, 2021 at 10:22
  • $\begingroup$ It makes sense to have it same as attack phase, sadly that means that when the attack time knob is turned, it can be heard that the delay changes instead of being smooth. And my limiter and compressor uses two different attack knobs, thats going to be tricky.. $\endgroup$
    – Invariant
    Commented Dec 7, 2021 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.