I'm getting the decibel values in negative. I just want to plot these values on a graph ranging from 0 to 100. So is there any way to convert the decibel values into positive values?
It's quite common for 0 dB to correspond to full scale input (remember that a plain dB scale actually defines a ratio, not an absolute value, so the meaning of 0 dB is somewhat arbitrary). For e.g. 16 bit audio, values might typically range from 0 dB to -96 dB. To represent this on a scale of 0 - 100 you could just add 96 dB to bring this range up to 0..+96 dB.
This is not a solution specific to decibels, but if you want your scale to be from 0-100, take your minimum value (lets call it minVal), and add -minVal to get 0. Then divide it by your maximum value, and multiply by 100.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With