Page 5 of 9

Re: Zero Delay Feedback Filter

PostPosted: Wed Mar 26, 2014 6:10 pm
by KG_is_back
OH, now I see it... that is very weird... I don't know where the problem could be...

Re: Zero Delay Feedback Filter

PostPosted: Wed Mar 26, 2014 6:18 pm
by tor
big credit for trying. thank you! ;)

Re: Zero Delay Feedback Filter

PostPosted: Thu Mar 27, 2014 7:51 pm
by tor
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 1216 times

Re: Zero Delay Feedback Filter

PostPosted: Thu Mar 27, 2014 9:42 pm
by MegaHurtz
Probably the math skills in the execution order.
Also notice there is no differentiation "probably" 8-)

Re: Zero Delay Feedback Filter

PostPosted: Thu Mar 27, 2014 10:03 pm
by tor
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.

Re: Zero Delay Feedback Filter

PostPosted: Fri Mar 28, 2014 9:51 pm
by martinvicanek
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.

Re: Zero Delay Feedback Filter

PostPosted: Fri Mar 28, 2014 11:26 pm
by KG_is_back
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...

Re: Zero Delay Feedback Filter

PostPosted: Fri Mar 28, 2014 11:45 pm
by tor
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 ;)

Re: Zero Delay Feedback Filter

PostPosted: Sat Mar 29, 2014 6:11 pm
by martinvicanek
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 27131 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 27131 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 27131 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.

Re: Zero Delay Feedback Filter

PostPosted: Sat Mar 29, 2014 7:36 pm
by tor
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