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

Fractional Delay Fir Interpolation (Repost)

DSP related issues, mathematics, processing and techniques

Fractional Delay Fir Interpolation (Repost)

Postby Tepeix » Mon Feb 20, 2023 5:34 pm

Because of the spammers this post might had be erased by error !!(
I don't remember all.. But here's a little resume.)

I was presenting (a very naive) fractional delay with fir interpolation.
This first delay have lot of attenuation in the treble..

--
Martin Vicaneck explain me that fir interpolation might reduce a very little or more the treble, but one advantage is to have a linear group delay (same delay for all frequency).
While it's also possible to get more linear phase response with higher order of allpass interpolation.
(i hope i don't deform to much what you say)

--
Then i come back with the little problematic i was encountering to improve my delay.
The coefficient of the fir might be shift for one sample.
Interpolating 2 set of sample (in linear interpolation this time), produce some error, the filter become also less symmetric.

So using a larger window (more sample and coefficient) might help ?
Not so much because if we want to preserve the high we will use a function, sync that ripple more and more with the size of the windows. For each ripple, the linear interpolation would produce error..
Image

So i was asking if we have to calculate a sync function for all coefficient
(which take a lot of cpu as a sin(x)/x)

--
Martin response me that we could only calculate sync once and that he would post an example later.

--
Then i make a little error ;) Having some improvement in my project i post another delay. Thinking that it have bad noise ratio for some reason..
But finaly testing it more, it works ok. (this one use 8X8 precalculated coeficient as table read to reduce error)


But if you have time to post an example Martin i will very like to see it and very very thanks !!!
It's true that i find some way to make an acceptable (but approximate) delay, but you where talking about another method ;)
Attachments
Naive and improved Fir Interpolation Delay.fsm
(175.25 KiB) Downloaded 812 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Fractional Delay Fir Interpolation (Repost)

Postby martinvicanek » Tue Feb 21, 2023 9:35 am

One thing you can do to ease interpolation is oversmpling - which in itself is a sort of interpolation. Here is an example that I came up with after some experienting. MIght not be easy to read, sorry about that.
Attachments
OversampledLagrangeDelay.fsm
(34.44 KiB) Downloaded 809 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Fractional Delay Fir Interpolation (Repost)

Postby Tepeix » Tue Feb 21, 2023 4:13 pm

Very thanks, Fantastic !

I have yet to understand how it works, but very interesting !!
If i understand well, it's a lagrange interpolator that have linear phase like a fir would do,
using 8 oversampled sample ?
Edit: Finally i think it's a lagrange interpolation upsampled.
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Fractional Delay Fir Interpolation (Repost)

Postby martinvicanek » Tue Feb 21, 2023 8:24 pm

Yes, it is a Lagrnge interpolator with 4x oversampling. The Lagrange interpolator as such is linear phase, however, the oversampling is not. May be a bit inconsistent, now that I think about it. Do you have a particular usecase in mind?
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Fractional Delay Fir Interpolation (Repost)

Postby Tepeix » Tue Feb 21, 2023 9:43 pm

Ok !
I do not have a special usecase..
I like to try make every type possible of delay, the fir was one i was not very knowing or understanding, then i understand recently the principle.
(i make this one also with different interpolation, but the lagrange was a copy of another code i find (and don't understand): viewtopic.php?f=4&t=94540)

It's another think to know in which design some of those delay would improve think.. I'm not sure by know,
but i'm always happy to have a lot of options and thinks to try.. Like so much delay that even if i could not hear the difference, i want to have each type ;)

I was thinking, maybe when it downsample it erase the band where the non linear phase occur ?
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Fractional Delay Fir Interpolation (Repost)

Postby Tepeix » Wed Feb 22, 2023 4:20 pm

In fact it's almost an obsession.. I'm already thinking about other delay code but i better have to finish my vst project !)
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Fractional Delay Fir Interpolation (Repost)

Postby Tepeix » Wed Feb 22, 2023 9:21 pm

For example, i could not resist to try to make this one..

A very experimental and imprecise design..

If it's linear phase it would only be a miracle ;)
The idea is to oversample by 3. (in a non very linear way)
Then hope that a fir interpolation of 6 sample (6 of 9 with shift) with triangular window would solve the phase
distortion.. And maybe it doesn't downsample greatly too ?..
Attachments
Oversample3X firdelay experimental.fsm
(59.06 KiB) Downloaded 810 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Fractional Delay Fir Interpolation (Repost)

Postby Tepeix » Thu Feb 23, 2023 3:24 pm

Now i find this one randomly. (was sure it could not work but it is..)
Close to an allpass interpolation, but the phase is different.
Maybe some frequency are not shifted in a regular way ?

I'm pretty sure it might distort more the phase more but it's plane frequency with no divide involved.

(Oups.... sorry for this, in fact it's just the same as an allpass interpolation but using 1-frac instead of 1-frac/1+frac. :oops: :oops:
This would normally produce some ring mod, but the shift in frequency is not so easy to hear, i retain this for where low cpu is needed and low precision permitted)
Attachments
DeviantPassDelay.fsm
(89.02 KiB) Downloaded 805 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Fractional Delay Fir Interpolation (Repost)

Postby Tepeix » Wed Mar 01, 2023 11:25 am

Another delay..
But this is more experimental and research than a better delay..

It improve the response of linear interpolation for frequency but i'm not sure for group delay..


It oversample by 3.. But does it really do it right ?? > This seams to not change the frequency response..

Maybe i have to to downsample using 3 time a filter ?

But using a fir for that it seams logic to only use one filter, because the effect of this filter for one sample do not depend of the effect on the other sample as they are no recursion... ...
Or maybe i need very more precise filter that actually erase any frequency after nyquist ? ....

Finally the improvement in frequency come more from a change in this fir "downsample" filter,
when the frac is 0.5, it change to get back some treble...

So a very immature and experimental design..
But i learn a lot, it's very interesting to see what happen when trying to read between sample..


The cool part is the way to write 4 oversample + 3 sample in 4 memory.
As the fir filter will be symetric we could reverse the last memory and add
it to the present one, getting a 0a+2a,0b+1c,0c+1b,1a+1a.
Attachments
3X oversample linear delayv2.fsm
(74.7 KiB) Downloaded 814 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 24 guests