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

Zero Delay Feedback Filter

DSP related issues, mathematics, processing and techniques

Re: Zero Delay Feedback Filter

Postby KG_is_back » Wed Mar 26, 2014 6:10 pm

OH, now I see it... that is very weird... I don't know where the problem could be...
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Zero Delay Feedback Filter

Postby tor » Wed Mar 26, 2014 6:18 pm

big credit for trying. thank you! ;)
tor
 
Posts: 114
Joined: Fri Sep 24, 2010 5:54 pm

Re: Zero Delay Feedback Filter

Postby tor » Thu Mar 27, 2014 7:51 pm

Now this is strange too, simply by changing order of the subtractions on the first line of code (and the equal in next part) change the behaviour of the filter. It should have the same output as before but it does not.
ZDF filter OS DP not yet fixed6.fsm
(239.38 KiB) Downloaded 1309 times
tor
 
Posts: 114
Joined: Fri Sep 24, 2010 5:54 pm

Re: Zero Delay Feedback Filter

Postby MegaHurtz » Thu Mar 27, 2014 9:42 pm

Probably the math skills in the execution order.
Also notice there is no differentiation "probably" 8-)
192k @ 8ms
User avatar
MegaHurtz
 
Posts: 105
Joined: Mon Aug 11, 2008 6:29 pm
Location: Eindhoven/Nederland

Re: Zero Delay Feedback Filter

Postby tor » Thu Mar 27, 2014 10:03 pm

As with the strage behaviour in the first place it is just close to nyquist there is difference with the reordered version. The math and order in both examples are correct.
tor
 
Posts: 114
Joined: Fri Sep 24, 2010 5:54 pm

Re: Zero Delay Feedback Filter

Postby martinvicanek » Fri Mar 28, 2014 9:51 pm

Yes, that's really weird. But why would you want double precision in the first place? There may be a point with the direct forms, but I don't think it is an issue with this filter type.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Zero Delay Feedback Filter

Postby KG_is_back » Fri Mar 28, 2014 11:26 pm

martinvicanek wrote:Yes, that's really weird. But why would you want double precision in the first place? There may be a point with the direct forms, but I don't think it is an issue with this filter type.


double precision is always welcome.... if nothing else then as an marketing strategy...
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Zero Delay Feedback Filter

Postby tor » Fri Mar 28, 2014 11:45 pm

I must admit i have not made measurements with this filter but as martinvicanek said there is a significant difference with direct form filters. Any feedback structure produce rounding errors and noise, and with direct forms you get a "thighter" and a more stable low frequency response with double precision. My goal is simply to squeeze the most quality i can out of this.

I sure would like to know why my implementation does not work ;)
tor
 
Posts: 114
Joined: Fri Sep 24, 2010 5:54 pm

Re: Zero Delay Feedback Filter

Postby martinvicanek » Sat Mar 29, 2014 6:11 pm

tor wrote:I sure would like to know why my implementation does not work ;)
I think it has to do with the feedback topology and the way how FS evaluates loops. The following three examples illustrate the point.

The first schematic shows a loop with a gain factor 1/2 and a unit delay. The output shows a geometric progression as it should, where each sample has half the value of the previous sample. The Impulse primitive is there to start off the series.
loop1.png
loop1.png (22.59 KiB) Viewed 28508 times

So far so good. Now consider the second schematic: still a loop with gain factor 1/2 and unit delay, only the order of the two primitives is reversed. You would expect the same result, but it is not so. :o Apparently there is a 2 samples delay in the loop! That reminds me of tor's finding, where a trivial change of the order of operations led to a different result.
loop2.png
loop2.png (21.3 KiB) Viewed 28508 times

In the next schematic I have removed the unit delay from the feedback loop altogether. This is something that should not be permitted, however FS somehow adds a unit delay into the feedback path and the result is the same as in the first example. :?
loop3.png
loop3.png (21.37 KiB) Viewed 28508 times

Now you could argue that examples 2 and 3 are consistent, but then example 1 does not fit in. (I prefer to think that example 1 gives the expected result while 2 and 3 do not.)

Okay, so in tor's filter schematic there are at least two feedback loops which behave in a similarly uncontrolled way. I have spent quite some time experimenting with unit delays inserted at various places, however I have not been able to get it right. So my conclusion is to avoid wiring loops in FS, as it can lead to unpredictable results even in very simple cases (refer to above examples). If you must have loops, use code. The stages 0 to 3 offer some control which is missing when only wiring primitives.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Zero Delay Feedback Filter

Postby tor » Sat Mar 29, 2014 7:36 pm

good work and thank you for providing this good investigation. never occured to me to test it like that.

the manual states that any feedback wiring of stream/poly automatically makes a one sample delay. so in the examples with the delaymodule one should actually get two samples delay. so your example loop2 and loop3 is as one should expect. but example loop1 is the mysterie loop. it clearly shows there is some inconsistency in how the interpreted code is generated. this inconcistency makes it impossible to make designs with a predictable result. and the more complex it gets the harder it is to debug.

as FS do not provide all necessary double word upcodes in asm to do this and the code module does not provide any double word functions it is impossible to do this with code.

some times i think maybe the limitations and flaws in FS/SM is there deliberately to hinder competition for the "real" developers that use this app just as an mockup/test enviroment. i sent a mail to support many days ago, no answer so far. i wonder about all the people who paied for 1 year of updates they must be very disappointed when support and updates are so absent. so many bug reports and feature wishes that probably is quite easy fixed is just ignored. :evil:

sorry, i just had to get this little blowout
tor
 
Posts: 114
Joined: Fri Sep 24, 2010 5:54 pm

PreviousNext

Return to DSP

Who is online

Users browsing this forum: No registered users and 7 guests