Real-time Bilinear Transform Library

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hey devs-

I was wondering if anyone of you are familiar with a C/C++ library or header that does a bilinear transformation, ideally converting up to a 4th-order transfer function? Any help would be greatly appreciated :-D

THANKS!
~ oygosound.org ~

Post

Well ... do it 'per-hand':

Code: Select all

1   z - 1
- * -----
k   z + 1

as² + bs + c


 a    z² - 2z + 1    b    z - 1
--- * ----------- + --- * ----- + c
 k²   z² + 2z + 1    k    z + 1

 a    z² - 2z + 1   bk     z² - 1      ck²   z² + 2z + 1
--- * ----------- + -- * ----------- + --- * -----------
 k²   z² + 2z + 1   k²   z² + 2z + 1    k²   z² + 2z + 1
 
az² - 2az + a + bkz² - bk + ck²z² + 2ck²z + ck²

z²(a0 + a1*k + a2*k²) + z(2*a2*k² - 2*a0) + (a0 - a1*k + a2*k²)
---------------------------------------------------------------
z²(b0 + b1*k + b2*k²) + z(2*b2*k² - 2*b0) + (b0 - b1*k + b2*k²)


         1
LP: -----------
    s² + 2s + 1

         s²
HP: -----------
    s² + 2s + 1

         s
BP: -----------
    s² + 2s + 1

       s² + 1
BR: -----------
    s² + 2s + 1


k = tan(PI * FC/FS)

Common:
    B0 = 1 + 2 / Q * k + k²
    B1 = 2 * k² - 2
    B2 = 1 - 2 / Q * k + k²

LP:
	A0 = k²
	A1 = 2 * k²
	A2 = k²

HP:
	A0 = 1
	A1 = -2
	A2 = 1
	
BP:
	A0 = k
	A1 = 0
	A2 = -k
	
BR:
	A0 = 1 + k²
	A1 = 2*k² - 2
	A2 = 1 + k²
... when time becomes a loop ...
---
Intel i7 3770k @3.5GHz, 16GB RAM, Windows 7 / Ubuntu 16.04, Cubase Artist, Reaktor 6, Superior Drummer 3, M-Audio Audiophile 2496, Akai MPK-249, Roland TD-11KV+

Post

so what you meant by 'per-hand' was copy/paste from the internet :P

Anyway, what I needed was a solution for a 4th order polynomial, and I needed it to run real-time, so I basically followed this method:
1) break up the 4th ordered analog prototype into four 1st ordered sections using Ferrari's method http://en.wikipedia.org/wiki/Quartic_fu ... s_solution
2) do a bilinear transformation using the s=2*FS(1-z)/(1+z) substitution
3) combine the results into two cascaded 2nd ordered sections
~ oygosound.org ~

Post

Copy'n'paste from the internet? Huh? Well ... if you think so ... nevermind.
... when time becomes a loop ...
---
Intel i7 3770k @3.5GHz, 16GB RAM, Windows 7 / Ubuntu 16.04, Cubase Artist, Reaktor 6, Superior Drummer 3, M-Audio Audiophile 2496, Akai MPK-249, Roland TD-11KV+

Post

neotec wrote:Copy'n'paste from the internet? Huh? Well ... if you think so ... nevermind.
as a new member, he probably did not expect someone being so kind to elaborately derive all these equations. for fourth order, i'd certainly prefer to let the algebra be done by some computer algebra system such as maxima. i think, it's going to be messy and error-prone to do by hand.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Robin from www.rs-met.com wrote:
neotec wrote:Copy'n'paste from the internet? Huh? Well ... if you think so ... nevermind.
as a new member, he probably did not expect someone being so kind to elaborately derive all these equations. for fourth order, i'd certainly prefer to let the algebra be done by some computer algebra system such as maxima. i think, it's going to be messy and error-prone to do by hand.
Yeah, you're possibly right.

I did this by hand to get known to it. In my opinion it is good to know how things work. And if you do this z-transform using variables/placeholders, then you only have to do it once and can simply insert different values and get directly usable filters. :)
... when time becomes a loop ...
---
Intel i7 3770k @3.5GHz, 16GB RAM, Windows 7 / Ubuntu 16.04, Cubase Artist, Reaktor 6, Superior Drummer 3, M-Audio Audiophile 2496, Akai MPK-249, Roland TD-11KV+

Post

thank you, neotec and robin, for your responses. and i agree with you, neotec, about doing things by hand, its certainly the more erudite approach to engineering.
~ oygosound.org ~

Post

Sorry, if my post was a bit ... don't know what it was, though sry. :)

As of my experience, searching for a library, which is free and easy to use will take you (mostly) longer, than understanding it and doing it on your own. But if anybody knows such a lib (which is free and easy to use) please post it here.
... when time becomes a loop ...
---
Intel i7 3770k @3.5GHz, 16GB RAM, Windows 7 / Ubuntu 16.04, Cubase Artist, Reaktor 6, Superior Drummer 3, M-Audio Audiophile 2496, Akai MPK-249, Roland TD-11KV+

Post

Robin from www.rs-met.com wrote:
neotec wrote:Copy'n'paste from the internet? Huh? Well ... if you think so ... nevermind.
as a new member, he probably did not expect someone being so kind to elaborately derive all these equations. for fourth order, i'd certainly prefer to let the algebra be done by some computer algebra system such as maxima. i think, it's going to be messy and error-prone to do by hand.
Having recently derived (and then debugged after it behaved a bit weird) some fancy filters, I'd say the that sort of stuff tends to be messy and error prone even when done in a CAS. Doing it without a CAS tends to be twice as messy and error prone, so definitely +1 on your suggestion. :)

Post

This implementation might be too complete for your needs but the BLT is in there http://code.google.com/p/dspfilterscpp/

Post Reply

Return to “DSP and Plugin Development”