Compressor in feedback mode

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Maybe asked before:

what about the effective ratio of feedback compression?
Is is defined as shown below?

Let's start with feed forward steady state equation, hard knee:

if we have some derived detector signal x (of the input, for example an envelope follower output, transformed into log domain) in the dBFS-domain ABOVE the threshold (in dBFS), the negative gain G [in dB], responsible for gain reduction, is given to

G = (x - thr) * (1/R-1) = -a*(x - thr)

with a = (1-1/R)

This is what somebody would see applying a tone with given level for long enough attack/release.

Now if we think of a hard-knee feedback compressor with settled gain G and ratio R applied in the feedback path, we have

y = x + G

y here is the output signal where the (negative) gain G has been applied. Compared to the feed forward case, the feedback makes a "role change" of x with y, and we get

G = (y - thr) * (1/R-1) = (x + G - thr) * (1/R-1) = -a * (x + G - thr)

or

G = -a/(1+a) * (x-thr)

So when the compressor has settled, the effective equivalent feed forward ratio R2 can be derived as follows:

G = -a/(1+a) * (x-thr) = -b * (x-thr)

but b can also be written as b = 1-1/R2 with some effective ratio R2 which an equivalent feed forward compressor would have. Then we get:

-(1-1/R2) = -a/(1+a) or
1/R2 = 1 - a/(1+a) or
1/R2 = 1/(1+a) or

R2 = 2-1/R

This looks like the feedback transforms the compressor into one which has a maximum effective feed forward ratio of R2=2 when R goes to infinity.

In general, the dynamic behavior as a differential equation is changed for the feedback case, but the steady state equation for ratio seems to be like that shown above.

Now the question is: either there is a mistake here or when vendors write about ratios they don't mean the actual effective ratio R2. Is it true? Because it looks like a feedback compressor can never exceed a ratio of R2=2 and therefore squash the signal like a feed forward could do.

EDIT: just simulated with Matlab and got the proof.

Post

synthpark wrote: Thu Apr 25, 2024 12:45 pm either there is a mistake here ...
Not a mistake but unnecessary assumption: that infinity is highest compression ratio of equivalent feedforward compressor. Try negative compression ratios of equivalent feedforward comp.

Post

The whole idea of "ratio" basically makes very little sense when it comes to a feedforward design.

You see input increase by 1dB, you apply 50% (=0.5dB) gain reduction, that's a "ratio" of 2:1. You apply 75% gain reduction (=0.75dB), that's a 4:1 ratio. You apply 100% gain reduction, that's "infite" ratio. You apply 150% gain reduction, that's -2:1 ratio. It all looks very weird when you're looking at "ratios" here, because those really only make any real sense for a feedback design... but rather what we actually have is just some proportion of the input gain increase applied as gain reduction and because this is literally just a multiplication, we can do 2% or 200% or whatever. If you want the output to drop 80dB when the input exceeds the threshold by 1dB, then go for it. For a feedback design this would be impossible (the control loop wouldn't be stable if we exceeded "infinite" ratio), but for a feedforward design there's no problem, you can do whatever.

In fact, I think "ratio" as a user parameter is a terrible approach in general, 'cos it gives the user completely wrong idea of what to expect... but because the designers of classic compressors were thinking in terms of how their (feedback) devices operate rather than in terms of how their users are going to operate their devices.. we're now pretty much stuck with this horrible design mistake.

Post

+1 that ratio is not very specific. Take the example of a compressor with a soft-knee curve, which will gradually fade gain reduction until the top of it's curve. Until that curve top is encountered, the ratio is far less than what may be stated. Compressor setting ratio is relative to the threshold, but the real ratio is the relative comparison of the input and output signals. The ratio calculation of going from 1:1 to 1:inf to 1:-2 is just broken math. I have made a few compressor algorithms and never used ratio as the actual determinating parameter for how it actually controls the signal. IMO it's more a small part of a larger equation, where in the scope of what the compressor may doing internally is useful. Real ratio is the comparison of the relative gain of the input and output signal.

Post

mystran wrote: Thu Apr 25, 2024 10:42 pm The whole idea of "ratio" basically makes very little sense when it comes to a feedforward design.
Well, I find the opposite. From countless definitions in journals, text books etc. the ratio is the inverse of the ratio of the increase in output level given an increased input level.

So once the signal enters the compression reagion it will not experience the same dynamic fluctuation anymore, the idea of the compressor as such, and what the user will experience.

So for example, if the signal fluctuates between plusminus 5 dB inside the compression region, with a ratio of 2:1 = 2, the output only fluctuates around plusminus 2.5 dB.

But this is exactly the defintion of the FEEDFORWARD compressor based on the given equations, not the feedback compressor, because in the feedforward case we relate input to output.

So therefore it makes sense to calculate the equivalent feedforward ratio because that is what the user actually hears, he/she does not hear any internal signal, but the output, and ratio relates input to output as written above.

Now from a musical perspective it might look that forward compression ratios of 1...2 are actually best, so one could believe that the rather misleading scaling for the feedback case is more practical.
Last edited by synthpark on Fri Apr 26, 2024 5:53 am, edited 1 time in total.

Post

camsr wrote: Thu Apr 25, 2024 11:28 pm +1 that ratio is not very specific. Take the example of a compressor with a soft-knee curve, which will gradually fade gain reduction until the top of it's curve. Until that curve top is encountered, the ratio is far less than what may be stated. Compressor setting ratio is relative to the threshold, but the real ratio is the relative comparison of the input and output signals. The ratio calculation of going from 1:1 to 1:inf to 1:-2 is just broken math. I have made a few compressor algorithms and never used ratio as the actual determinating parameter for how it actually controls the signal. IMO it's more a small part of a larger equation, where in the scope of what the compressor may doing internally is useful. Real ratio is the comparison of the relative gain of the input and output signal.
There is no broken math here. With R2 = forward ratio:

For feedback ratio of R=1 you get R2=2-1=1
For feedback ratio of R=10 you get R2=2-1/10 = 19/10 or almost R2=2.

When you take soft knee compression it means that the ratio continously increases from 1 to its final value so you have to use the derivative as R.

Post

synthpark wrote: Fri Apr 26, 2024 5:52 am
When you take soft knee compression it means that the ratio continously increases from 1 to its final value so you have to use the derivative as R.
So, use that derivative. Also there is plenty of broken math, when trying to apply the threshold ratio to feedback compression as you have. Maybe not in your formula you wrote, but the words you spoke.

Post

camsr wrote: Fri Apr 26, 2024 6:48 am So, use that derivative. Also there is plenty of broken math, when trying to apply the threshold ratio to feedback compression as you have. Maybe not in your formula you wrote, but the words you spoke.
Ok, maybe you show me which statement is "broken". Meanwhile I am going to check if VSTs like the Glue, which are feedback per design, behave as I would expect.

Post

synthpark wrote: Fri Apr 26, 2024 7:20 am Ok, maybe you show me which statement is "broken".
This one:
synthpark wrote: Because it looks like a feedback compressor can never exceed a ratio of R2=2

Post

urosh wrote: Fri Apr 26, 2024 8:44 am
synthpark wrote: Fri Apr 26, 2024 7:20 am Ok, maybe you show me which statement is "broken".
This one:
synthpark wrote: Because it looks like a feedback compressor can never exceed a ratio of R2=2
LOL That sentence is correct. R2 is the equivalent feedforward ratio.
Do you know matlab?

Try this code:

function audio_fb_comp_demo_v1(ft, N, freq, a_dB, thr_dB, ratio, att_ms, rel_ms)

% audio_fb_comp_demo_v1(ft, N, freq, a_dB, thr_dB, ratio, att_ms, rel_ms)

att_coeff = calc_lp1_coeff(ft, att_ms);
rel_coeff = calc_lp1_coeff(ft, rel_ms);

x = 10^(a_dB/20)*sin(2*pi*freq/ft*(0:N-1));
y = zeros(1, N);
gr = zeros(1, N);

g = 1;
c = (1/ratio-1);
st = 0;

for k = 1:N
xx = st;
xx = 20*log10(max(abs(xx),eps));
gt = c*max(0,xx-thr_dB);
gt = 10^(gt/20);
if g > gt
g = g + (gt-g)*att_coeff;
else
g = g + (gt-g)*rel_coeff;
end
gr(k) = -20*log10(g);
st = g*x(k);
y(k) = st;
end

figure;
plot(x);
grid on; hold on;
plot(y,'r--');
legend('input', 'output');

figure;
plot(gr);
grid on;
title('gain reduction [dB]');

function y = calc_lp1_coeff(ft, t_ms)

% y = calc_lp1_coeff(ft, t_ms)

y = 2.3*1000.0/ft;
if t_ms <= 0
y = 1.0;
else
y = 1.0-exp(-y/t_ms);
end

and convince yourself! Signal 40 dB above threshold, feedback mode, 20 dB GR shown for ratio R=1000. Because R2 = 2-1/1000 is almost 2, so 40 dB become 20 dB.

>> audio_fb_comp_demo_v1(48e3, 1e6, 440, 0, -40, 1000, 1, 200)
You do not have the required permissions to view the files attached to this post.

Post

synthpark wrote: Fri Apr 26, 2024 5:46 am So for example, if the signal fluctuates between plusminus 5 dB inside the compression region, with a ratio of 2:1 = 2, the output only fluctuates around plusminus 2.5 dB.

But this is exactly the defintion of the FEEDFORWARD compressor based on the given equations, not the feedback compressor, because in the feedforward case we relate input to output.
I think this is where you are making a mistake. If we define ratio as input:output, then your example case is 2:1 whether the compressor is feedback or feedforward. If we define as output:input then it's 1:2 whether the compressor is feedback or feedforward and frankly that's essentially just a different notational choice (swap the two numbers).

How you compute the actual gain (or gain differentials in case of feedback design) in the actual sidechain to obtain the desired ratio varies depending on whether it's a feedforward or a feedback design, but the ratio is what it is, whatever the design of the compressor.
Now from a musical perspective it might look that forward compression ratios of 1...2 are actually best, so one could believe that the rather misleading scaling for the feedback case is more practical.
Ok, now you're not being intellectually honest.

Post

synthpark wrote: Fri Apr 26, 2024 9:20 am LOL
Yes, LOL.
Same topology (very simple peak detecting FB comp), different ratios:
FB_Ratio_Ctrl.png
synthpark wrote: R2 = 2-1/R
R=-0.5 => R2=4
R=-0.1 => R2=12
You do not have the required permissions to view the files attached to this post.

Post

urosh wrote: Fri Apr 26, 2024 10:06 am R=-0.5 => R2=4
R=-0.1 => R2=12
Ok, of course. So far I was assuming the internal circuitry is doing the same as for the forward comp. That is you just disconnect the input path from the sidechain path and connect the output path to the sidechain path and there you go.

Now you come up with something I was thinking for a short but discarded it. In order to get ratios beyond 2, your comp internally needs to work in expander mode and apply a negative ratio. Because abs(R) < 1 means expander, and negative Ratio is negative. This gives you some funny curve, which looks like this:

But now imagine very high desired ratios, like for a limiter. Then a infinitesimal small output change must produce a large gain change in order to fullfill the requirements, which is prone to noise, component deviations etc. Is it really like that?
You do not have the required permissions to view the files attached to this post.

Post

synthpark wrote: Fri Apr 26, 2024 1:45 pm But now imagine very high desired ratios, like for a limiter. Then a infinitesimal small output change must produce a large gain change in order to fullfill the requirements, which is prone to noise, component deviations etc. Is it really like that?
With feedback compressors? Yes. That's why they rarely do more than 10:1 or maybe 20:1 if you're really lucky.

Post

mystran wrote: Fri Apr 26, 2024 2:11 pm
synthpark wrote: Fri Apr 26, 2024 1:45 pm But now imagine very high desired ratios, like for a limiter. Then a infinitesimal small output change must produce a large gain change in order to fullfill the requirements, which is prone to noise, component deviations etc. Is it really like that?
With feedback compressors? Yes. That's why they rarely do more than 10:1 or maybe 20:1 if you're really lucky.
Ok I checked the Glue and it seems it must do something like the curve shown above for target level versus input level, apart from doing odd things like shifting the threshold when going from 4:1 to 10:1. That essentially answers my question and means that you cannot just disconnect the input and connect the output to the detector of some forward compressor design. It is not as simple as that. Although formula seems correct.

That solves some pending design decision for a product, i.e. not to use feedback.
Thanks.

Post Reply

Return to “DSP and Plugin Development”