My recommendation to @lgvr123 is to not fret about perfect transference of parameters and just tune the controls by ear. Nothing wrong with being a connoisseur, though, and the question you’re asking is perfectly legitimate.
Let’s address the yet-unanswered question about the relationship between Q of a two-pole resonant lowpass/highpass filter and gain. Low and highpass filters are identical for the sake of peak gain, and it’s easier to look at a lowpass. (Bandpass filters have multiple conventions for peak gain.) The transfer function of a lowpass with a cutoff of 1 is:
H(s) = 1 / (s^2 + s/Q + 1)
However, the peak frequency and the cutoff frequency are not the same. The peak frequency (if defined) is actually slightly lower, and it gets closer to the cutoff as Q is increased.
Thus, there are two possible meanings for “resonance” in dB. One is simply the gain at the cutoff. This is computed as |H(j)|
, which is simply:
|H(j)| = 1 / |j^2 + j/Q + 1| = Q.
It’s possible this is the formula your VST plugin uses.
But, I think it’ll be fun to derive the actual peak gain. To do so, we need to first compute the peak frequency. We define the power P(w) = |H(jw)|^2
and define a local maximum by setting the derivative P'(w) = 0
and finding a real w > 0
. A little expansion shows that
P(w) = 1 / ((1 - w^2)^2 + (w / Q)^2)
and calculus gives
P'(w) = - (2(1 - w^2)2w + 2w / Q^2) / ((1 - w^2)^2 + (w / Q)^2)^2
Setting this equal to zero mercifully gets rid of the denominator, and solving for w
gives:
w = sqrt(1 - 1 / (2 Q^2))
Note that this peak only exists if Q > 1 / sqrt(2) or about 0.707. If your VST allows the resonance to dip below 0 dB then that’s a hint that they’re probably just using resonance = Q.
To get the peak gain, we plug this back into the transfer function as |H(jw)|
:
|H(jw)| = 1 / |((jw)^2 + (jw)/Q + 1|
= 1 / |1 / (2 Q^2) + (j sqrt(1 - 1 / (2 Q^2)))/Q|
gain = Q^2 / sqrt(Q^2 - 1 / 4)
I have checked the correctness of this with numerical computation (compute |H(w)|
for many w
and find the w
that produces a maximum).
To invert and get Q in terms of gain, the quadratic formula along with the requirement that Q > 1 / sqrt(2)
gives:
Q = sqrt((gain^2 + sqrt(gain^4 - gain^2)) / 2)
So, for RLPF/RHPF/BHiPass/BLowPass you can use the above formulas to convert between Q and peak gain. Remember to take the reciprocal as they all ask for 1/Q.
I am not sure how the variable slope is implemented. There are fractional order filters out there but nobody seems to use them. Crossfading between different cascaded series filters is a good guess, but I’d have to do some more thinking to determine the outcome of phase cancellation.