tecknoize ·
Quick question... How do you calculate dB from a -1 to 1 magnitude range? 😕
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
tecknoize ·
Quick question... How do you calculate dB from a -1 to 1 magnitude range? 😕
stefan ·
tecknoize wrote: Quick question... How do you calculate dB from a -1 to 1 magnitude range? 😕
First you need to find the amplitude of the signal, so take the absolute value of it. Then to convert a linear amplitude to a logarithmic (dB) one do: dB = 20 * log10(linearAmplitude)
tecknoize ·
Thanks (I think) it works! But how does software like FL or Cubase get a steady dB display when playing a sine wave for exemple? Do they analyse a small part to get the max dB of this part? I think I'm missing something... might be too tired 😮
stefan ·
tecknoize wrote: Thanks (I think) it works! But how does software like FL or Cubase get a steady dB display when playing a sine wave for exemple? Do they analyse a small part to get the max dB of this part? I think I'm missing something... might be too tired 😮
Analyse a small part would give you something similar to a RMS value. However, I'd recommend hooking the envelope follower up at the input signal, very short attack and long release (1-2 seconds) and then calculate the dB value from the output of the envelope follower.
Tom7777 ·
I recently had the need to do this myself, im guessing the same applys for 0-1 values right? can you do calculations like that with green data or would it have to be done in the code component? I don't do maths stuff much 😀
sambean ·
You'd want to do as little as possible with the steams/code to save cpu..
So what to do is take the signal you wan't to measure, attatch a mono to float, then do the rest in 'greens':
Signal->mono2float->abs module->x20->log10->dB
This has no smoothing though, to do this have a look in the 'Level meter' control in the toolbox, there's a green smoothie there... 😉
BTW devs, the level meter still hangs if it gets a #inf or #NAN value, and it's quite difficult to remedy if you don't know where the smooth module is.. Try feeding it a 1/0 signal to see..
Cheers
Sam
Tom7777 ·
Thanks Sambean 😀
stefan ·
Thanks sambean! Needs to be looked into!
Wrote something here? To have a post removed or your name hidden, write to [email protected].