Page 1 of 1

better db to linear 0-1 (especially array)

Posted: Tue May 19, 2020 8:41 pm
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

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

Posted: Tue May 19, 2020 9:49 pm
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.

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

Posted: Wed May 20, 2020 7:11 pm
by juha_tp
How's exp(0.115129254649702 * n) ?

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

Posted: Fri May 22, 2020 11:29 pm
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.