DSPRelated.com
Forums

Fractional order IIR

Started by RoelVugts 2 weeks ago11 replieslatest reply 2 weeks ago209 views

Hi,

I would like to create a fractional order allpass filter but i'm not sure how to do this or if it is even possible.

I currently have a 10th order allpass filter created by cascading 5 biquads (SVF implemenation). Say i would want to make a 10.5 th order allpass filter, how would this be done?

I'm assuming i would need to use interpolated delays, but i'm a bit lost at calculating coefficients for these delays.

Any suggestions? Thanks!



[ - ]
Reply by DanBoschenDecember 28, 2024

Fractional order filters can be approximated by substituting fractional all-pass filter sections for z^{-1} blocks in standard filter structures (typically FIR structures) but what is your motivation or ultimate goal for having 10.5th order? Knowing that may illuminate another solution.

[ - ]
Reply by RoelVugtsDecember 28, 2024

Thanks for your help. The ultimate goal is to have an audio processing algorithm where the filter order is controlled by a slider. Instead of having a stepped slider that increments in integers i would like it to increment continuously (for as far that is possible in the digital domain). 

[ - ]
Reply by DanBoschenDecember 28, 2024

Wouldn’t you want to control the levels in dB, corner frequencies and transition rate (in dB/octave for example, and then have the algorithm determine what order is required to get there (for a give n error criterion)

[ - ]
Reply by RoelVugtsDecember 28, 2024

For any filter other than an allpass filter, yes. But i feel like allpass filters need different controls. I noticed that when cascading 2nd order allpass filters, the amount of delay / phase-shift can be musically interesting to control. The amount of delay corresponds to the amount of cascades, but it would be nice to have a smooth control over the delay amount.


I hope this makes sense.

[ - ]
Reply by neiroberDecember 28, 2024

Hi,

Another way to obtain a variable delay would be to use a Fractional Delay FIR filter.  You can easily compute the coefficients of a filter with a delay of D + u samples, where D = (ntaps -1)/2 and u is a fraction of a sample.  Then you would need to recompute the coefficients to change the fractional delay u to a new value.

I wrote a post on fractional delay FIR filters here:

https://www.dsprelated.com/showarticle/1327.php

-- Neil

[ - ]
Reply by RoelVugtsDecember 28, 2024

Thanks! This might also be a good solution. Although it has to be implemented in a real-time system and with large delay settings, i suspect there might be some performance issues compared to the IIR filter. But I'll have to try it first to be sure.

[ - ]
Reply by napiermDecember 28, 2024

If you can arrange to band-limit to Fs/4 (or up-sample) then a polyphase fractional delay will work for low cost.  Dial in any fraction of Mu over [0,1).  For more delay than a fraction, delay by a whole number of samples before (or after) the fractional delay.  Conceptually pretty easy.

FWIW,

Mark Napier


[ - ]
Reply by neiroberDecember 28, 2024

I found an article on the Matlab website about fractional delay FIRs.  Besides the approach I used, they also discuss using a Lagrange polynomial interpolator (using a Farrow structure).


https://www.mathworks.com/help/dsp/ug/design-of-fr...

[ - ]
Reply by DanBoschenDecember 28, 2024

Yes that makes sense but it’s not necessarily order that dictates the delay: a typical 2nd order all pass section (biquad) will have a peak in delay at its resonance frequency with the magnitude of that peak (and reciprocal of its width) given by how close we place the pole zero pair to the unit circle. With that we see the challenge in meeting a specific delay profile in that we have to trace it out by placing “delay tent poles” with every section that we use. I show that graphically with more detail at this post:


https://dsp.stackexchange.com/a/91657/21048

I’ve usually seen delay settings given by delay parameters specifically (with similar corner frequencies and target delays and max error to what I described earlier) and then let the solver determine the order necessary to meet that target. This blog post by Matt Lang may be of interest for that:


https://mattsdsp.blogspot.com/2022/10/design-of-iir-allpass-filters-least.html?m=0

[ - ]
Reply by RoelVugtsDecember 28, 2024

Interesting, i think i get what you are saying. I'll have a look at the blog post and see if this works for me.


[ - ]
Reply by DanBoschenDecember 28, 2024

Be sure to see the DSP.stackexchange link I just added as I think it gets to that main point simpler. I also concur with what Neil wrote about using fractional delay FIR filters where you can emulate an all pass very well over most of the Nyquist range (FIR filter can’t implement a true all pass) and the least squares solution to any target response is much simpler to implement and will always be stable / causal. This applies when you don’t care about overall delay or computational resources. A simple approach to create an arbitrary FIR filter to any response is to derive rhe coefficients from a downsampled inverse FFT of an arbitrary complex frequency response. You oversample in the frequency domain to avoid the effects of time domain aliasing and window the resulting coefficients to significantly reduce ripple/ error.