Dynamic Range Compression - Release???

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

I think did indeed intended the down-sampling for efficiency; but not helpful for aliasing as you've pointed out.

I will check out logistic functions and "fuzzy logic" theory. Had a quick look, think I see what you're getting at; the switching from attack to release states is too abrupt and a smoother transition is required.

Thanks again
Ger

Post

how about this shaper?

double r = fabs(x);
if (r < 0.5) { return x*x; }
return r-0.25;
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

g_loughnan wrote:... the switching from attack to release states is too abrupt and a smoother transition is required.
Well, for something basic but actually useful, you can release before your attack. My goto for simple yet effective:

Code: Select all

buf0 = smooth_max(input , buf0- rel_coef *  buf0);
buf1 = buf1 + att_coef*( buf0-buf1);///envelope
Yeah, I know - trading a branch for another with 'max' but if you look at it branchless:

Code: Select all

float smooth_max (float a, float b)
{
return (a+b + smooth_ABS(a-b)) *0.5f;
}
Just do your own smooth_abs - or there is an example that I posted a couple posts back...

Job done :wink:

Andrew

Post

antto wrote:how about this shaper?

double r = fabs(x);
if (r < 0.5) { return x*x; }
return r-0.25;
This seems good. It's only shaping the signal below 0.5 though, just adding a DC offset above.. could this be dodgy splitting the signal by applying linear and non-linear operations at different times?

Post

g_loughnan wrote:
antto wrote:how about this shaper?

double r = fabs(x);
if (r < 0.5) { return x*x; }
return r-0.25;
This seems good. It's only shaping the signal below 0.5 though, just adding a DC offset above.. could this be dodgy splitting the signal by applying linear and non-linear operations at different times?
No. The derivative is equal between the two functions at the discontinuity. But the bias could introduce some quantization.

Post

Andrew, thanks for that. Is smooth_ABS() applied after compression? We need to calculate amplitude reduction due to compression using:

amp_out = thresh + (abs(x) - thresh)/ratio;

smoothing abs(x) before compression would lead to inaccurate compression (in terms of level) as far as I can gather, so we'd need to wait until after compression stage to smooth abs(x)? So, smooth_ABS(x) is used just for attack/release application?

Post

Sorry, my bad, was thinking the upper limit of x*x was 0.9*0.9 =0.81.. staring at the computer too long today! It's a clever shaper, but the only gain is efficiency, where I'd probably go for a 1-pole filter. I haven't looked at any numerical analysis in a few years, but I sense that applying linear and non-linear operations to the signal at different stages will have some undesired consequences.
Last edited by g_loughnan on Tue Aug 26, 2014 8:46 pm, edited 1 time in total.

Post

Whatever, it's the same thing.

Post

g_loughnan wrote:Sorry, my bad, was thinking the upper limit of x*x was 0.9*0.9 =0.81.. staring at the computer too long today! It's a clever shaper, but the only gain is efficiency, where I'd probably go for a 1-pole filter. I haven't looked at any numerical analysis in a few years, but I suspect that applying linear and non-linear operations to the signal at different stages will have some undesired consequences.

Post

I use a lot the web app on madtealab.com to evaluate waveshapers and curve functions :

http://madtealab.com/

Post

Cool app! Can it do piecewise functions?

Post

You can do it by using boolean functions like this for example

Code: Select all

f1(x) = abs(x)
f2(x) = (x * x) * (f1(x) < 0.5)
f3(x) = (f1(x)-0.25) * (f1(x) >= 0.5)
f4(x) = f2(x) + f3(x)
And then, you can display only f4(x) if you want

Post

Ok, get you. Thanks for that tip Wolfen666, handy web app!

Post Reply

Return to “DSP and Plugin Development”