Dynamic Range Compression - Release???
-
- KVRer
- Topic Starter
- 29 posts since 20 Feb, 2010
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
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
- KVRAF
- 2554 posts since 4 Sep, 2006 from 127.0.0.1
how about this shaper?
double r = fabs(x);
if (r < 0.5) { return x*x; }
return r-0.25;
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
..as long as it has BASS and it's LOUD!
irc.libera.chat >>> #kvr
- KVRian
- 1091 posts since 8 Feb, 2012 from South - Africa
Well, for something basic but actually useful, you can release before your attack. My goto for simple yet effective:g_loughnan wrote:... the switching from attack to release states is too abrupt and a smoother transition is required.
Code: Select all
buf0 = smooth_max(input , buf0- rel_coef * buf0);
buf1 = buf1 + att_coef*( buf0-buf1);///envelope
Code: Select all
float smooth_max (float a, float b)
{
return (a+b + smooth_ABS(a-b)) *0.5f;
}
Job done
Andrew
-
- KVRer
- Topic Starter
- 29 posts since 20 Feb, 2010
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?antto wrote:how about this shaper?
double r = fabs(x);
if (r < 0.5) { return x*x; }
return r-0.25;
-
- KVRAF
- 7405 posts since 17 Feb, 2005
No. The derivative is equal between the two functions at the discontinuity. But the bias could introduce some quantization.g_loughnan wrote: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?antto wrote:how about this shaper?
double r = fabs(x);
if (r < 0.5) { return x*x; }
return r-0.25;
-
- KVRer
- Topic Starter
- 29 posts since 20 Feb, 2010
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?
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?
-
- KVRer
- Topic Starter
- 29 posts since 20 Feb, 2010
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.
-
- KVRer
- Topic Starter
- 29 posts since 20 Feb, 2010
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.
-
- KVRian
- 1153 posts since 11 Aug, 2004 from Breuillet, France
I use a lot the web app on madtealab.com to evaluate waveshapers and curve functions :
http://madtealab.com/
http://madtealab.com/
-
- KVRer
- Topic Starter
- 29 posts since 20 Feb, 2010
Cool app! Can it do piecewise functions?
-
- KVRian
- 1153 posts since 11 Aug, 2004 from Breuillet, France
You can do it by using boolean functions like this for example
And then, you can display only f4(x) if you want
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)
-
- KVRer
- Topic Starter
- 29 posts since 20 Feb, 2010
Ok, get you. Thanks for that tip Wolfen666, handy web app!