better db to linear 0-1 (especially array)

For general discussion related FlowStone
Post Reply
User avatar
wlangfor@uoguelph.ca
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada
Contact:

better db to linear 0-1 (especially array)

Post by wlangfor@uoguelph.ca »

most methods involve using code or asm and that's not as efficient as this. I was working ona metering solution for My boardstation EQ and came up with this, so as to avoid any zero's. It's as close as you can get to -INF


First, send the signal to a nan to 0 made by trog or exonerate, on the top value of the selector, add this value in a string:

Code: Select all

-897.06939697265625


next send that signal to an array limit module made by trogluddite.

Replace the min with the same value in a string:

Code: Select all

-897.06939697265625


so next make two floats with these two values:

Code: Select all

0.00109043


and

Code: Select all

0.978191


and use all of it as follows

signal--->nan to 0 (edited)--->(0.00109043*signal)--------->(0.978191+signal)--------------> (final result 0-1)

this can be useful for just about anything. You could use it for floats also instead of arrays in a similar manner.

Robert
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: better db to linear 0-1 (especially array)

Post by tulamide »

That's an interesting approach, but in no way better than the usual

Code: Select all

10^(n/20)
## or
10^(n * 0.05)


You're converting strings (this alone takes longer than above calculation), use two code blocks and still multiply and add. It's ok, but not better.
"There lies the dog buried" (German saying translated literally)
juha_tp
Posts: 60
Joined: Fri Nov 09, 2018 10:37 pm

Re: better db to linear 0-1 (especially array)

Post by juha_tp »

How's exp(0.115129254649702 * n) ?
User avatar
wlangfor@uoguelph.ca
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada
Contact:

Re: better db to linear 0-1 (especially array)

Post by wlangfor@uoguelph.ca »

good feedback thanks, My goal however was to avoid the presence of a zero, other than in the case of a 0dBFS. So as to convert and utilize, which db conversion can miss.
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
Post Reply