Crazy look ahead limiter.
Posted: Thu May 25, 2017 11:29 am
Hi All,
I am new here and trying to get familiar with Flowstone.
One of my projects is this Frankenstein's monster of limiters. I figured that if you can do very quick gain changes when the signal is at or very close to zero it would be quite transparent. So I have created a limiter that measures the peak between zero crossing points, or for each half cycle. So I needed to know what 'future' peaks are going to be so the is a substantial delay introduced (100ms at the moment). To find each cycle's peak at the preceding zero crossing point I read a buffer backwards to reverse the signal, do a peak hold with resets when the signal crosses the zero point, and then reverse it back. I also do the same type of peak hold in the forwards direction. By delaying the main signal I get everything to match up.
It turns out that limiting based on every cycle's peak is not as transparent as I hoped so I hold the peak for 20ms and then hold it until the next zero crossing. This is much better especially when there is a lot of high-frequency content that gives you a zero crossing every several samples.
Much of this had been butchered from examples posted here. So thanks to those who have posted those.
I'm sure there is much to improve. (eg I have different code modules joined together that could be contained in one if I could figure it out). Anyway have a look and let me know what you think.
Cheers.
I am new here and trying to get familiar with Flowstone.
One of my projects is this Frankenstein's monster of limiters. I figured that if you can do very quick gain changes when the signal is at or very close to zero it would be quite transparent. So I have created a limiter that measures the peak between zero crossing points, or for each half cycle. So I needed to know what 'future' peaks are going to be so the is a substantial delay introduced (100ms at the moment). To find each cycle's peak at the preceding zero crossing point I read a buffer backwards to reverse the signal, do a peak hold with resets when the signal crosses the zero point, and then reverse it back. I also do the same type of peak hold in the forwards direction. By delaying the main signal I get everything to match up.
It turns out that limiting based on every cycle's peak is not as transparent as I hoped so I hold the peak for 20ms and then hold it until the next zero crossing. This is much better especially when there is a lot of high-frequency content that gives you a zero crossing every several samples.
Much of this had been butchered from examples posted here. So thanks to those who have posted those.
I'm sure there is much to improve. (eg I have different code modules joined together that could be contained in one if I could figure it out). Anyway have a look and let me know what you think.
Cheers.