Hi Ethan,

From: Ethan Fenn <et...@polyspectral.com>

In the language of z transforms, your algorithm is based on this kind of
identity:

(1+z^-1+z^-2+...+z^-15)/16 =
((1+z^-8)/2)*((1+z^-4)/2)*((1+z^-2)/2)*((1+z^-1)/2)


I also can't really read that.
I tried to look it up but failed. Just found that z-transform is
fourier transform for discrete signals.

It looks like Z^-8 means "the value of Z of 8 samples ago".
If so, I'd write my method as:

sumOf16 = SumOf8 + SumOf8^-8
SumOf8 = SumOf4 + SumOf4^-4
etcetera.


Whereas Tito's technique boils down to:

(1+z^-1+z^-2+...+z^-15)/16 = (1/16)*(1-z^16)/(1-z)

With fixed precision, your technique could give more accurate results. But,
the other idea is so much cheaper for large N that it can compensate for
this by dedicating more bits to the running sum.

If I understood Tito's method correctly, I thought it has trouble with
floating point.

(assuming fixed precision means fixed point, as opposed to floating
point)


It's really interesting that the same idea works for any operator (any
associative and commutative operator, I suppose), not just addition. Are
there any practical applications for this?


I use it in https://magnetophon.github.io/LazyLimiter/ a lookahead
limiter.

It's not used in the lookahead part, as you'd might expect, but:

It calculates how much gain reduction each coming sample needs, and gets
the minimum of that ( minimum dB value, so actually the point with most gain
reduction).

If there is a point with as much or more GR than we have currently, it
will not bother 'releasing'/'going back up'.  (hence lazy)

So a short peak will get a fast release, but a steady low sine will get
a constant GR, so no distortion.

I'm looking ahead 186 ms for this (for normal lookahead purposes you
only ned a few ms), so efficiency is needed.

Another use is for a peak hold meter, where you'd want the max of N
samples.

Speaking of which, I also found this algo, but again couldn't read it:

Highly efficient streaming sliding window (for peak hold):
https://www.kvraudio.com/forum/viewtopic.php?f=33&t=465829

I think it does the same, but I'm not sure.

I'd love to hear your thoughts on that one as well!

Thanks,
Bart.
_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to