|
Post by parenteau on Dec 8, 2018 18:31:13 GMT 1
So here is another problem I'm having with a documented formula:
I'm using a GUI "float function" module to exchange values between a image animation and a float patch memory( scaled *10 to float function to *0.1). The knob controls properly going from A to B but when I go B to A from the image I get the wrong values.
Formula outputs: Google: from db to volts 10 * 10 ^ ( 0 / 20 )=10 10 * 10 ^ ( -90 / 20 )=0.0003=0
from volts to db 20 * log10( 0 / 10 )=0 20 * log10( -90 / 10 )=-180
I also have to inject -3 outward or 3 inward (depending on the situation) to compensate for the readout, as the range will only make it from ~-90(ambiguous) to -3 (compensating for a waveform's -5 to 5).
The unit converter floats db to VCAdb including "(EXP)" give different results, there is no unit converter for GUI.
|
|
|
Post by Rob on Dec 8, 2018 19:51:28 GMT 1
You want volts to dB and back using subcontrols? Have you tried my module? It works bidirectionally: rhmodules.nl/blog/?p=118
|
|
|
Post by parenteau on Dec 8, 2018 20:29:59 GMT 1
Edit: The unit converter floats db to VCAdb including "(EXP)" give different results, there is no unit converter for GUI. to The unit converter floats db to VCAdb does give accurate results, but there is no unit converter for GUI. You want volts to dB and back using subcontrols? Have you tried my module? It works bidirectionally: rhmodules.nl/blog/?p=118I took a look and the application is the other way, db to volts. I'm avoiding 3rd party modules as much as possible unless absolutely necessary, for many reasons. So far I haven't used any, but I'm still on page 1. The float function should be able to handle this, but I just can't find the right inverse function of the exponetial "10 * 10 ^ ( db / 20 )", Mathway.com tells me its "20log(x)â20" but the product on google (my windows calculator is broken) is: "(20 log(-90)) - 20 = 19.0848502 + 27.2875271 i" google doesn't compute: "20log(0)â20" I imagine it's because the multiplication is by zero. Not quite sure what to do with that first 20. I've modified the formula in several ways to land on either end of the scale but the closest I can get is: 10+log(10)(X / 10); 10+log(10)(-90 / 10) = 1 10+log(10)(0 / 10) =10 Oddly enough, upon entering the formula, the output stays locked into 20.723. Just about ready to break out paper and pencil an solve for: fâ1(x)=10 * 10 ^ ( y / 20 ) manually. I'll give it another hour of brute force, try to unlock that 20.723, or throw something else at it.
|
|
|
Post by parenteau on Dec 8, 2018 22:04:05 GMT 1
The formulas are correct, it was my algorithm that needed adjusting.
Thanks for your consideration Rob.
|
|
|
Post by Rob on Dec 9, 2018 10:44:20 GMT 1
OK, good that you found the answer.
PS: my module output is also an input, when inserting a dB value on the right side you get a Volt value output on the left side.
Cheers,
Rob
|
|