Partial Fraction Decomposition (PFD) of an all-pole filter
Hello everyone,
I need to create a complex all-pole filter with the coefficients I got from an LPC signal analysis.
In Max, it doesn't seem possible to create this all-pole filter if the number of poles is greater than two.
I tested the filtergraph~ object which returns the suitable frequency response for an even number of poles (until 24).
But to implement it as an MSP filter, the only solution would consist in decomposing the all-pole coefficients into a set of bi-poles, i.e. a set of parallelized or cascaded biquad cells with 1. 0. 0. in the numerator.
This process is mathematically known as a partial fraction decomposition, and I wonder if some javascript code or MAX object already exist to perform it.
Thank you in advance.
Jojo
Hey, can't help with the decomposition thing, but I was playing with LPC a few years ago and made myself an allpole filter object for max. Nothing fancy, a straight forward allpole filter that takes its coefficients as a list. If you are on osx and want to check it out, look here:
https://vboehm.net/downloads
Thank you Volker,
I tested your LPC external that works great.
Basically I get the LPC coefficients with the gbr.lpc~ object developped by Ircam.
I also tested this nice toolkit written by Mark Cartwright : http://www.markcartwright.com/research/lpc-toolkit
I'm looking for PF decomposition process for 2 reasons :
- First, I thought to implement the all-pole filter with the standard cascade~ object, which is equivalent to a series of biquad~ objects. But clearly, a C external as you wrote it does the job very efficiently.
- Second, I wanted to plot the zeros/poles of the all-pole filter in a standard zplane~ object, in order to compare the associated formantic envelope with this of a slightly different sound (which will be used for LPC cross-synthesis ). But it seems that zplane~ only accepts coefs in the biquad~ format (until 24)...
Thus, I don't know if it's possible with Max to plot a zero/pole graph from a list of LPC coefficients corresponding to an all-pole filter of more than two poles....
Jojo
Hi again,
I looked at some PFD procedures with Matlab software and I found the function tf2sos
which exactly corresponds to what I want to achieve :) So my question now is : Does it exist a Max external which ensures the tf2sos
functionnality ?
Jojo
Hi, anyone have any resources on how to generate coeffs for vb.allpole~?
hi, typically you run some kind of analysis on a snippet of audio to obtain the filter coeffs, e.g. LPC.
Maaaany years ago I wrote some java classes to use in an mxj object, by hacking the relevant sources of praat. That's also where the coeffs in the help patch come from.
Here you can find a simple example (suited for voice analysis/resynthesis):
https://vboehm.net/maxobjects/lpc-burg.zip
This is fantastic, thank you
hi, im using pipo lpc and lpcformant from the MuBu library, and trying to figure out how to rebuild sound with these data. i must get something wrong here because when i use the coefficients to feed the filters(a few biquad~ or several onepoles, and vb.allpole~ as well), it always explode...
so instead of using the coefficients i use the formants' frequency and bandwidth as the center frequency and Q(frequency/bandwidth) to feed into the filtergraph object and connect it to the biquad~, but the resonant is too high and the results are all in high pitches..
i try to check the minimum and the maximum coefficients that output from the pipo lpc, most of numbers are normal, like between -1 to 1, a few bigger ones between 0 - |50|, and some are extreme like 300...which dont look like a coefficient at all. do i need to scale them, if so, the differences between them are so big, how do i scale?
or im totally wrong on this...i also download this patch https://vboehm.net/maxobjects/lpc-burg.zip thinking there must be some clues and unfortunately java doesnt run properly on my laptop, and i need to figure that out too..
thanks for reading this and it will be super helpful to give me some hints or direction or even example patches, cheers~
Can I assume what the original author is trying to do is an automated way of doing partial fractions to determine the bi-polar coefficients, which can then be coded up in Max to then pass to a set of cascading bi-polar filters? Or is it a question of how to perform partial fractions?
I remember doing this stuff in control systems at undergrade uni years ago, always felt it was a long winded process.
Not that I have tried it yet, what comes to mind is State Space analysis and from my reading of the method, it simplifies a very complex multi-pole system into a much smaller but equivalent (to within an approximation) set of poles.