Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

2th Order Allpass Fractional Delay

DSP related issues, mathematics, processing and techniques

2th Order Allpass Fractional Delay

Postby Tepeix » Tue Apr 11, 2023 11:55 pm

Here's a 2th allpass interpolation delay !)

But it's a very rough draft.. The coefficient are calculated in a very unconventional and approximate way...
If someone have a better way to calculate them don't hesitate to improve this !)

The 2th order help to improve the linear phase (or linear group delay) for some frequency.
I think that generally the coefficient are chosen to get the best phase for the bass.
I tried more to get the less possible phase distortion for the wider possible frequency.
Inevitably, the high of the signal will get more and more phase distortion in those two way..
But it seams that there's some choice of compromise..

(Maybe a way to achieve a even more perfect phase response would be to calculate 2 delay,
one with perfect bass and the other with perfect high then to mix them.. ...)

What do you think of it ?
Attachments
2th AllpassDelay.fsm
(148.79 KiB) Downloaded 1418 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: 2th Order Allpass Fractional Delay

Postby Tepeix » Wed Apr 12, 2023 12:02 pm

A very little optimization.
There was 2 unnecessary multiply in the interpolation.

(c2*y0) + (c1*y1) + y2 - (out*c1) - (prevout*c2) could become (c2*(y0-prevout)) + (c1*(y1-out)) +y2.
Attachments
2th AllpassDelay v2.fsm
(149.49 KiB) Downloaded 1403 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: 2th Order Allpass Fractional Delay

Postby Tepeix » Wed Apr 12, 2023 4:52 pm

And now a 3th order allpass delay !)
The barbarious design of the coefficient is even more simple here.
But they might exist more precise formula !
Attachments
3th AllpassDelay.fsm
(99.31 KiB) Downloaded 1385 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: 2th Order Allpass Fractional Delay

Postby martinvicanek » Wed Apr 12, 2023 7:47 pm

What you describe sounds like Thiran allpass interpolators.
https://www.dsprelated.com/freebooks/pa ... ators.html
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: 2th Order Allpass Fractional Delay

Postby Tepeix » Wed Apr 12, 2023 9:42 pm

Thanks ! Searching with this base i find some other way to calculate the coefficients.

But it's a little tricky..
For a 3 order the frac must be +2, and it will give a delay from 2 to 3 sample (+base delay)

So if D = frac+2 we could use as coefficient :
C1= -3*(d-3)/(D+1) C2 = 3(D-2)*(D-3)/(D+1)*(D+2) C3= -(D-1)*(D-2)*(D-3)/(D+1)*(D+2)*(D+3)

I was thinking that it doesn't work in my allpass type because i tested first with a D<2 and in this case the filter is unstable.

Using this we get the 3th Thiran allpass. Very more precise than my approximation !
Attachments
Thiran 3thAllpassDelayv2.fsm
(v2 now in real time)
(62.92 KiB) Downloaded 1404 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: 2th Order Allpass Fractional Delay

Postby Tepeix » Fri Apr 14, 2023 3:07 pm

A very little optimization for the thiran delay.
I discover that we could reverse the way the allpass are connected.
Using out(x)-sample(x) instead of sample(x)-out(x) make just the coefficient to reverse to produce the same effect.
So there's no need to make the coefficient negative, (just getting 4 sub less in the code..)

I also seen that this kind of allpass need other coefficient design. Here for higher order, the coefficient could not go from -1 to 1 or it become unstable, depending of the first coefficient, the next might have slower value.
(for example c1 = 0.5 and c2 = -0.5 is unstable but c1 = 0.5 c2 = -0.45 is ok)
Attachments
Thiran 3thAllpassDelayv3.fsm
(82.69 KiB) Downloaded 1419 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: 2th Order Allpass Fractional Delay

Postby Tepeix » Fri Apr 14, 2023 8:44 pm

Finally i could not resist to try this one.
The optimal delay.. But it's just a name. it's difficult to know if a particular design is optimized..
Particularly for a simple delay..
This one is mono and a 4th order allpass.
Using sse it's possible to load 4 sample in one time. and also get 4 sample from out.
The coefficient are very simple, giving more phase distortion in bass..
I've seen that every new allpass order could give more precision, but like what i read from thiran allpass,
the more you already have, the less you gain adding more.
(just get a hard debug time, when i was trying to reverse the sse out order instead of the sample delay order..)
Attachments
OptimalDelay v2.fsm
(118.42 KiB) Downloaded 1426 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: 2th Order Allpass Fractional Delay

Postby Tepeix » Mon Apr 17, 2023 2:02 pm

Here's an allpass delay library that regroup all of those current research.
Just added 2 more, a 2th thiran and a 8th with naive coefficient..

The allpass seams a perfect solution to keep every frequency at the same level, but they have problem with transiant when the delay is changing..
I don't know how fast it might change and in which situation it provoke those problem.. For example for digital waveguide modeling they are some studies to diminish this problem of transient..

Downside is also the phase distortion that would occur at higher frequency.
Bass would be shifted slowly from 0 to 1 frac delay, and more linearly,
but the last higher frequency would always jump from 0 to 1 like they are no interpolation at all !
(but we don't hear it..)

Using higher order we could have a more linear shift for every frequency,
but the real improvement is more for the last octave of the sound..
When you switch to log view, you could see that it doesn't change so much to have higher order (excepting for more precise application)
Attachments
AllpassDelayLibrary.fsm
(138.32 KiB) Downloaded 1402 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm


Return to DSP

Who is online

Users browsing this forum: No registered users and 9 guests