Feedback compressor and high ratio
-
- KVRist
- Topic Starter
- 44 posts since 17 Aug, 2008 from Netherlands
I'm trying to figure out how to make a feedback compressor with a high ratio. That is, I found a way of doing it, but I don't think it's correct. Feedback tends to sound better, because it reaches the end result using different curves. If anyone could explain what I'm missing I would be really grateful
So I have an input signal and a block that calculates how much attenuation is needed and moves there (basically, threshold / input level, never above 1).
Let's say you have a feed forward compressor with ratio INF:1. Then, if a sound comes in that's 10 dB too loud, the block that calculated the attenuation will see that it's 10 dB too loud and start attenuating until it reaches -10 dB. Good.
Let's say that you now change the compressor to feedback, without changing anything else. The level will be based on the output level. Once the level has been dropped by 5 dB, the part that calculates the attenuation also will say that it needs to go to -5 dB, so it will stop there. Hence, the actual ratio will be close to 2:1 instead of INF:1. In fact, that's how many feedback compressors work.
But... there are also compressors out there that use feedback mode and still can reach (close to) INF:1 ratio.
I can easily change my feedback algorithm to take into account where it already is, but that would basically just replicate the feed forward behavior.
I can also simply change my calculation (use the numbers as described in the feedback calculation, but perform the attenuation twice for the actual output), which actually gives something that looks like the traditional feedback behavior but with the correct ratio and with feedback-like audio behavior. However, this doesn't seem to make much sense, and I think I'm overlooking something.
So I have an input signal and a block that calculates how much attenuation is needed and moves there (basically, threshold / input level, never above 1).
Let's say you have a feed forward compressor with ratio INF:1. Then, if a sound comes in that's 10 dB too loud, the block that calculated the attenuation will see that it's 10 dB too loud and start attenuating until it reaches -10 dB. Good.
Let's say that you now change the compressor to feedback, without changing anything else. The level will be based on the output level. Once the level has been dropped by 5 dB, the part that calculates the attenuation also will say that it needs to go to -5 dB, so it will stop there. Hence, the actual ratio will be close to 2:1 instead of INF:1. In fact, that's how many feedback compressors work.
But... there are also compressors out there that use feedback mode and still can reach (close to) INF:1 ratio.
I can easily change my feedback algorithm to take into account where it already is, but that would basically just replicate the feed forward behavior.
I can also simply change my calculation (use the numbers as described in the feedback calculation, but perform the attenuation twice for the actual output), which actually gives something that looks like the traditional feedback behavior but with the correct ratio and with feedback-like audio behavior. However, this doesn't seem to make much sense, and I think I'm overlooking something.
- KVRAF
- 4021 posts since 7 Sep, 2002
In feedback compressor you usually square the compression gain factor, and double the attack and release constants. There are various ways to do feedback compression exist. Alternatively, it's possible to use "sqrt(gain)" in feedback part, and "gain" as overall gain adjustment: this works as a "partial" feedback.
- KVRAF
- 7890 posts since 12 Feb, 2006 from Helsinki, Finland
If you measure that you need 2dB reduction with regards to input (ie. feed-forward design) you can simply set the gain g=10^(-2/20), right?
If you measure it at the output, you already have some gain factor g0 applied, so what you need to do is add the new gain reduction to the existing one (ie. multiply the gain coefficients) to get g=g0*10^(-2/20).
Obviously for practical implementation you will either have to insert one sample delay into the feedback path (not necessarily a big deal for longer attack times) or figure out a way to solve the thing implicitly (with the timing circuit in the loop), but that's the basic idea.
If you measure it at the output, you already have some gain factor g0 applied, so what you need to do is add the new gain reduction to the existing one (ie. multiply the gain coefficients) to get g=g0*10^(-2/20).
Obviously for practical implementation you will either have to insert one sample delay into the feedback path (not necessarily a big deal for longer attack times) or figure out a way to solve the thing implicitly (with the timing circuit in the loop), but that's the basic idea.
- KVRian
- 1169 posts since 24 Feb, 2012
The trick hides behind the term "PID" control. Right now, you're probably just running a "P" or "I" controller. It's a shame how little control theory is known is the music scene and audio specific literature, as this stuff isn't exactly nebulous (it really is an enormous and incredibly well documented field).
Another critical aspect is the fact that you'll need very little delay in the loop to keep it stable and high ratios (if not done right, they'll oscillate badly and not control the dynamic range at all).
https://www.embeddedrelated.com/showarticle/943.php
Another critical aspect is the fact that you'll need very little delay in the loop to keep it stable and high ratios (if not done right, they'll oscillate badly and not control the dynamic range at all).
https://www.embeddedrelated.com/showarticle/943.php
Last edited by FabienTDR on Tue Sep 20, 2016 5:05 pm, edited 1 time in total.
Fabien from Tokyo Dawn Records
Check out my audio processors over at the Tokyo Dawn Labs!
Check out my audio processors over at the Tokyo Dawn Labs!
- KVRian
- 1169 posts since 24 Feb, 2012
rather than feeding back the audio, what about feeding back the last GR value and multiply the SC input with it? It has interesting properties.mystran wrote:Obviously for practical implementation you will either have to insert one sample delay into the feedback path (not necessarily a big deal for longer attack times) or figure out a way to solve the thing implicitly (with the timing circuit in the loop), but that's the basic idea.
Fabien from Tokyo Dawn Records
Check out my audio processors over at the Tokyo Dawn Labs!
Check out my audio processors over at the Tokyo Dawn Labs!
-
- KVRAF
- 7400 posts since 17 Feb, 2005
I am doing that in a compressor too, but it's not feedback in the usual sense. But to highlight the differences here, normal feedback commutates the output GR with the sidechain, which is why sqrt is required to "correct" it. Sidechain feedback on input has the opposite gain effect, requires square to fix.FabienTDR wrote:rather than feeding back the audio, what about feeding back the last GR value and multiply the SC input with it? It has interesting properties.mystran wrote:Obviously for practical implementation you will either have to insert one sample delay into the feedback path (not necessarily a big deal for longer attack times) or figure out a way to solve the thing implicitly (with the timing circuit in the loop), but that's the basic idea.
-
- KVRist
- Topic Starter
- 44 posts since 17 Aug, 2008 from Netherlands
Interesting! My current compressor uses something that's somewhere between P and I (D seems to be unusable for varying inputs). However I can see several other places in my software where I am using something like PID (actually ID) without knowing that there actually was a name for itFabienTDR wrote:The trick hides behind the term "PID" control.
https://www.embeddedrelated.com/showarticle/943.php