## foo_dsp_effect

#####
Reply #58 –

1. Yes, I will correct it.

BTW: IMHO logarithmic scale is better than linear.

b) LSH/HSH is from http://www.musicdsp.org/files/biquad.c (which is public domain)

So, it is "Based on the work "Cookbook formulae for audio EQ biquad filter coefficients" by Robert Bristow-Johnson"

It's interesting that this cookbook contains different formulae for LoShelf/HiShelf etc.

from musicdsp.org/files/biquad.c:

A = pow(10, dbGain /40);

omega = 2 * M_PI * freq /srate;

sn = sin(omega);

cs = cos(omega);

beta = sqrt(A + A);

...

b0 = A * ((A + 1) - (A - 1) * cs + beta * sn);

from Cookbook:

A = 10^(dBgain/40)

w0 = 2*pi*f0/Fs

alpha = sin(w0)/(2*Q)

...

b0 = A * ((A + 1) - (A - 1) * cos(w0) + 2 * sqrt(A) * alpha)

beta * sn = sqrt(2*A) * sin(omega) = sqrt(2) * sqrt(A) * sin(omega)

2 * sqrt(A) * alpha = 2 * sqrt(A) * sin(omega) / (2 * Q) = sqrt(A) * sin(omega) / Q

sqrt(2)*sqrt(A)*sin(omega) == sqrt(A)*sin(omega)/Q only if Q == sqrt(0.5)