I have these 6 coefficients for peaking EQ:
b0 = 1 + (α ⋅ A)
b1 = −2⋅ωC
b2 = 1 - (α ⋅ A)
a0 = 1 + (α / A)
a1 = −2 ⋅ ωC
a2 = 1 − (α / A)
With these intermediate variables:
ωc = 2 ⋅ π ⋅ fc / fs
ωS = sin(ωc)
ωC = cos(ωc)
A = sqrt(10^(G/20))
α = ωS / (2Q)
The documentation of vDSP_deq22()
states that "5 single-precision inputs, filter coefficients" should be passed but I have 6 coefficients! Also, in what order do I pass them to vDSP_deq22()
?
Update (17/05): I recommend everyone to use my DSP class I released on github: https://github.com/bartolsthoorn/NVDSP It'll probably save you quite some work.
A 2nd-order filter can be expressed as the following difference equation (
a
andb
may be interchanged depending on how you've defined them):You can divide through by
a0
to get an expression fory[n]
, and then you only need 5 coefficients.The documentation I found here specifies the order (see the equation that's given). It looks like the order is: