Most harmonically pure attack shape?

DSP, Plug-in and Host development discussion.
User avatar
Smashed Transistors
KVRist
132 posts since 10 Oct, 2014

Post Tue Jul 31, 2018 1:49 am

A very old trick used in early digital equipment consists in changing the gain when the input crosses zero.

This is very light on CPU.
It does not click.
It preserves the waveform of the input signal.
See you here and there... Youtube, Google Play, SoundCloud...

JCJR
KVRAF
2345 posts since 17 Apr, 2005 from S.E. TN

Re: Most harmonically pure attack shape?

Post Tue Jul 31, 2018 11:36 am

Smashed Transistors wrote:A very old trick used in early digital equipment consists in changing the gain when the input crosses zero.

This is very light on CPU.
It does not click.
It preserves the waveform of the input signal.
The zero crossing may be better than some random location, dunno. Or alternately, peaks where the instantaneous slope is hopefully "near 0".

However, in my experience which could be wrong, sudden changes in wave slope can be perceived by the ear as a click. It depends on context in the audio and is not predictable. Sometimes a sudden slope change is not noticed as a click and other times it sounds like a very annoying click. I've debugged clicks in auto-crossfade algorithms where the slope change is so subtle you can barely see it in the audio editor window even when you know exactly where to look, but it is annoying obvious click to the ear. Other times, rather ugly sudden slope changes as visible to the eye, which sound fine to the ear.

So if suddenly changing gain at a zero-crossing, or splicing poorly-matched waveforms at zero-crossings, causes sudden slope change, it will not always sound like a click but will sound like a click often enough that IMO it is not a very useful strategy to rely on. Even if it "works" transparently 9 times out of 10, the other 1 times out of 10 is the deal-breaker. :)

That is why lookahead is so useful in hard limiters. Without the lookahead, the first over-thresh gain change is a sudden slope change which is not always heard as a click, but is often enough heard as a click as to be useless. Or in the case of some of the old non-lookahead analog limiters, it seemed a gentler trade-off to suffer a relatively "rare and gentle" click rather than suffer frequent hard-clipping splatters. :)

mystran
KVRAF
4983 posts since 12 Feb, 2006 from Helsinki, Finland

Re: Most harmonically pure attack shape?

Post Tue Jul 31, 2018 12:21 pm

JCJR wrote: However, in my experience which could be wrong, sudden changes in wave slope can be perceived by the ear as a click. It depends on context in the audio and is not predictable. Sometimes a sudden slope change is not noticed as a click and other times it sounds like a very annoying click.
The click from instantaneous jump that results in a discontinuity has a spectral fall-off of 6dB/octave (like a saw-tooth or a square). The click from a discontinuity in slope has a spectral fall-off of 12dB/octave (like a triangle). That sort of makes it objectively better, but still bad. :)
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

User avatar
Smashed Transistors
KVRist
132 posts since 10 Oct, 2014

Re: Most harmonically pure attack shape?

Post Wed Aug 01, 2018 8:56 am

Yes, the trick can and must be improved with an interpolation of the gain around the zero crossing.

One particular case were it is sensitive is when you want sharp modulator attacks in a phase modulation. The "update gain on zero crossing" trick is quite efficient in this case.

First with the Axoloti factory object (linear interpolation over 16 samples), second with "update gain on zero crossing".

https://soundcloud.com/thierry-rocheboi ... modulation
See you here and there... Youtube, Google Play, SoundCloud...

Return to “DSP and Plug-in Development”