filtergtaph~ gain = gain in dB .. how?

Lasse Munk's icon

Hi All,

I am puzzled on how I make it, so if I input "6" in the gain parameter to filtergraph, I get 6 dB of gain at the cutoff, - 6 = - 6 dB of gain etc.

I use the peak notch filter

Max Patch
Copy patch and select New From Clipboard in Max.

Sorry, I get kind of cold water on my cheeks when I try to understand filters / the math behind filters.

all the best, lasse

do.while's icon

Hello !
it expects linear input not logarithmic . i know its confusing and it would be great to have control over it internally .
look here at this conversion , its more friendly .

#EDIT

Max Patch
Copy patch and select New From Clipboard in Max.
Lasse Munk's icon

this saved a lot of time. Thank you so much!

Lasse Munk's icon

can you paste the conversation again? didn't see the link, and would like to understand it, if the conversation explains how to :)

do.while's icon

cant u see anything ? maybe its a forum bug . so again ...

Max Patch
Copy patch and select New From Clipboard in Max.

and in attachment

linearValue.maxpat
Max Patch
joeman's icon

[atodb]

do.while's icon

[dbtoa] u mean

#EDIT
with [dbtoa] u will notice a bit of decimal offset , that wonders me if its true value or there is precision problem compared to literal conversion

Lasse Munk's icon

thank you to both. Yes i noticed that too. I do seem to remember however, that a doubling of amplitude gives a 6.02 dB of increase, and not 6.00 dB as commonly stated. Maybe I do remember wrong or misunderstood something?

This would argue that the dbtoa is more precise than your expression - but again, the math side of these things are really not my strong side :)

do.while's icon

oh , i didnt know about the result of doubling , good to know , it means im not familiar with how linear formula should work for DB . its offset puzzled me for a while , but i think for such cases it doesnt make a big difference . using [dbtoa] would be the most obvious choice anyway .

Lasse Munk's icon

no not at all .. i don't think it is possible to hear the difference! i didn't know about the dbtoa - thank you for this!

I sent a mail to cycling support to ask them to include it as an example for filtergraph~ .. i'm most probably not the first or last who would like to be able to control this object by add'ing in dB :)

Good day to all!

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Decibels are based on powers of 10 not powers of 2. The fact that 6dB and -6dB are very close to 2.0 and 0.5 is a happy coincidence and a useful rule of thumb, but is not a precise measurement.

do.while's icon

thats great , im happy to learn it Christopher . thanks !