[SOLVED] Look at my next post to see four function for calculating decibels!
hi, I'm working with audio and build a function to find out the Dezibel's of an audio signal:
this works as expected and return the decibels of an audio signal as in AUDACITY
But now I need the reverse case. I have a given Decibel value and need to find out the resulting Level
How Can I do this?
This is a working example to demonstrate the function:
hi, I'm working with audio and build a function to find out the Dezibel's of an audio signal:
B4X:
factor=level/SamplingRate
Decibel = Logarithm(factor*factor,10)*10
this works as expected and return the decibels of an audio signal as in AUDACITY
But now I need the reverse case. I have a given Decibel value and need to find out the resulting Level
How Can I do this?
This is a working example to demonstrate the function:
B4X:
Sub LogaTest
Dim Level As Int=30
Dim Dezibel, factor As Double
Dim Percent As Int
Dim SamplingRate=32768
For i=0 To 12
Level=Level*2
factor= Level/SamplingRate
Dezibel =Logarithm(factor*factor,10)*10
Percent=factor*100
Log("Level= " & Level & " (=" & Percent & "%) =" & $" $1.1{Dezibel}"$ & "dB ")
Next
End Sub
Last edited: