Transient handling algorithm?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Hi,
How does one implement a transient handling algorithm? (Something similar to Voxengo's TransGainer or SPL's Transient Designer.) How to detect transients?

Transient Designer uses a “differential envelope”. There is some info in the tech-talk section of their manual (spl.info/fileadmin/user_upload/anleitungen/english/TransientDesigner4_9842_OM_E.pdf).

Could someone elaborate on this concept of level-independent envelope processing which doesn't need conventional compressor “threshold” control.

Thanks!
Danijel

Post


Post

The basics are simple: use fast attack and slow attack envelope followers in parallel and estimate difference between the two. However, in practice you'll need some peculiar envelope followers that have a special shape, or otherwise "rectification" process won't be precise leading to over-reaction (stuttering) or under-reaction (skipping of obvious transients). I personally have never achieved to have a good detection quality in a broad-band setting (song or mix), you'll need several bands at least or otherwise higher-frequency transients may become masked by low-frequency signals.
Image

Post

Aleksey Vaneev wrote:The basics are simple: use fast attack and slow attack envelope followers in parallel and estimate difference between the two. However, in practice you'll need some peculiar envelope followers that have a special shape, or otherwise "rectification" process won't be precise leading to over-reaction (stuttering) or under-reaction (skipping of obvious transients). I personally have never achieved to have a good detection quality in a broad-band setting (song or mix), you'll need several bands at least or otherwise higher-frequency transients may become masked by low-frequency signals.
Thanks Aleksey.
When I calculate "normal" envelopes,

Code: Select all

for i=1:size            
    if(envelope(i-1) < samples(i))
        envelope(i) = envelope(i-1) * attack + (1-attack) * samples(i);
    else
        envelope(i) = envelope(i-1) * release + (1-release) * samples(i);     
    end     
end
this is what I get (plot shows 3 envelopes with 3 different attack times):

Image

Is that the over-reaction that you were talking about?

Post

I changed attack and release times, and managed to have a much cleaner envelope:

Image

Does that look usable for some simple transient shaper?

Thanks for any advice.

Post

Danijel.Domazet wrote:differential envelope
I believe this means it looks for particular a rate of change (a 'differential' or 'derivative' in calculus) as the transient trigger.

Post

Ninja_Edit wrote:
Danijel.Domazet wrote:differential envelope
I believe this means it looks for particular a rate of change (a 'differential' or 'derivative' in calculus) as the transient trigger.
Have a look at manual for SPLs Transient Designer, they call it "Differential Envelope Technology" and state that this is env1 - env2. So I'm pretty sure it isn't a derivative.

Post

Danijel.Domazet wrote:
Image

Is that the over-reaction that you were talking about?
Yes, it is. You managed to get a cleaner version below, but it will probably work with plain drum tracks only. Try it on a full mix and you'll get incorrect events. I've got good results only when I tweaked envelope shapes of the envelopes (S-curve vs log curve) beside attack/release times.
Image

Post

Just a quick idea: it may be a good idea to use ratio of envelopes, not their difference. Produces slightly better rectification. But in analog world this is not practical, of course.
Image

Post

Hmmm, I tried the SPL plug-in for UAD and it does get some false positives, and a lot of misses when some longer tail / reverb was added. Somehow it sounds as if the actual transient envelope always has the same shape. It also leaks a lot of initial transient material, i.e. one can clearly hear an Attack before the envelope kicks in. I wonder if that is what it's supposed to sound like...?

In any case, the false positives (or over-reaction, as you put it) in my own attempts have always put me off, while material that I'd typically use it for (drums...) was served as well with a normal compressor/expander.

I might check out Transgainer.

Post

Urs wrote:I might check out Transgainer.
It's not perfect either, especially on loud over-compressed verses. There is a reason for this: the ratio between peak and average signal level is too small for stable detection. Precise B algorithm is as good as I could ever get at transient detection.
Image

Post

It helps to have a definition in mind as to what a transient is. It could be a form of spurious noise for example. SPL's definition is a time-differentiated change in wideband magnitude.

Post

It helps to have a definition in mind as to what a transient is. It could be a form of spurious noise for example. SPL's definition is a time-differentiated change in wideband magnitude.
Lets make a list of possible meanings then.

1) spurious noise
2) a time-differentiated change in wideband magnitude.
3) decaying exponentials before a steady state is reached (in the context of 'steady state sinusoidal analysis')
4) ?
~stratum~

Post

Non-smooth (high sideband) change in banded magnitude.

Post

Urs wrote:Somehow it sounds as if the actual transient envelope always has the same shape.
A bunch of my old electronic instrumental music from the 1980's and the only convenient copies are stereo mixes recorded at the time to PCM 501 and beta tape as mixdown deck. Transferred fresh copies to computer last year from the old tapes.

The audio fidelity, noise and mix are not stupidly bad, but I wish they were punchier sounding. Maybe the electronic instruments of the time were too "smooth". Or maybe I programmed the patches too smooth. Or perhaps excessively compressed.

I tried multiband expansion which did not work so good on full mixes because expansion tended to only expand loud transients in the mixes. Transients below threshold don't get expanded. So it made the mixes more ragged-sounding rather than "punchier".

Was thinking sometime to try making some kind of multiband transient tool. Sure I could try plugins already available, but whats the fun in that?

Maybe creating the transient enhancement envelopes from overlapped envelope followers (as discussed in this thread) would be "best". However it is difficult to make fast envelope followers with low ripple. Unless brilliantly done, I'd expect some intermodulation distortion if punching up transients with control signals directly-derived by doing math on envelope followers.

Was thinking triggered AR envelopes might have a "cleaner sound". An antialiased triggered AR envelope shouldn't add so much IMD, because the AR envelope wouldn't contain residue of audio ripple from the envelope followers. For instance if wanting to punch up transients in a certain frequency band by 2 dB, and the detection is good and level-insensitive, then it could be set to enhance loud transients by the 2 dB, and it would also enhance the quiet transients by the same 2 dB in that band.

If some transient plugin authors might have followed the same reasoning, then maybe that is why the transient envelopes in some plugins seem to always have the same shape?

I had fairly good multiband transient detection in an old app which was intended to detect tempo maps in full mixes (among other things), but it was non-realtime. Never tried to do it realtime that I can recall. I used the "envelope difference" method as the first phase of detection. That old program would scan the entire song to create a long timestamped list of broadband transients plus extra timestamped lists of band-limited transients.

Each element in the lists also saved the "relative amplitude" of the transient. In other words, regardless whether the transient might peak at -24 dB or -3 db in the song, it would save the difference in amplitude between the transient peak versus the level right before the transient occurred. Then the program did a "pruning loop" to discard redundant detected "beats". After pruning, each "detected beat" in the song was only represented by a single transient event in the lists-- Rather than one individual song transient possibly being duplicated in several lists, with each redundant copy possibly "not quite the same timestamp".

Maybe for audio processing the pruning would be a bad thing, or maybe should be done differently. I just wanted a map of accurate timestamped transients for tempo detection and such.

SPL was IMO real innovative inventing the first analog version. A unique clever use of the "envelope difference" method.

The "envelope difference" technique was a "fairly common" analog trick decades before SPL made that transient designer analog device. It was a good way to convert noisy periodic signals into a pulse train. So you can feed the cleaned-up pulse train into a PLL or whatever. Maybe SPL was the first to think up the transient-enhancement use of the trick? Dunno.

Post Reply

Return to “DSP and Plugin Development”