phyphox Forums
Questions on analysis cycles - Printable Version

+- phyphox Forums (https://phyphox.org/forums)
+-- Forum: App-Feedback (https://phyphox.org/forums/forumdisplay.php?fid=6)
+--- Forum: Bugs and Problems (https://phyphox.org/forums/forumdisplay.php?fid=9)
+--- Thread: Questions on analysis cycles (/showthread.php?tid=1253)



Questions on analysis cycles - Uwe - 01-03-2021

Hi,
I really love Phyphox - evenĀ sometimes having very hard times to find out how to make an analysis part to behave the way I need.

Lately I read hereĀ https://phyphox.org/wiki/index.php/Phyphox_file_format about the feature of cycles.
I wanted to play around with this but couldn't find the attribute in experiment editor.
Is this something not accessible via the editor, meaning I've to add manually to the experiment's XML file ?

And here's another related question:
during a single (!) cycle do
  1. module calculations "consume" all values it finds in it's input buffer(s) (might be necessary for some modules like "average" vs "add"which uses multiple inputs for the sum)
    or
  2. do they "eat" just a single buffer value per cycle ?

From my understand so far option 2 would result in buffer length acting as timely delay while for option 1 buffer length would have to fit the type/amount of data coming in.
Is there a best practice to select for a buffer length ?

Any last question: is there a way to directly access the value of cycles (so I may visualize it for learning purposes); I know I might also build a constant counter but don't know whether this will behaves the same way.

Thanks !!


RE: Questions on analysis cycles - Sebastian Staacks - 01-04-2021

1. Yes, cycles are not supported by the editor. I have to admit that the editor has fallen behind the development of phyphox for several versions now as we are internally discussing/planing to simplify the editor and redesign it to be easier for beginners while guiding advanced users to the XML format by showing more prominently what code is created in the editor. Unfortunately, these plans have not really developed far, which is also due to limited development capacity and instead we did not touch the editor much in case it would be rewritten anyways. Hope we can resolve this situation soon.

2. In each cycle the module use their inputs in the same way they always do. They take all the data and if "clear" is set to true, the input buffer is cleared afterwards. In fact, with cycles the analysis process is pretty much the same as always, phyphox acts as if the modules with not matching cycles do not exist. I think the problem here is how the analysis process is represented in the editor: It is shown as a graph (not in the sense of "plot" but as a network of connections) where every output is directly connected to one or more inputs. This is not exactly what happens under the hood. Instead, outputs and inputs are connected to buffers (or "data-containers"), which persist across multiple cycles. So you can write a value to a buffer at the end of one cycle and read it during the next cycle. Unfortunately, this cannot be visualized in the way the editor works right now and this is the reason that some configurations cannot be done with the editor and one of the reasons that we are thinking about basically redesigning it. - This visualization seemed to be so much easier when we came up with it, but in the long run it turned out to be very problematic.

3. I am not entirely sure if I understand what you are asking about the buffer length. The modules use the amount of data that is present in the buffer. If there are three values in a buffer with a capactiy for 1000 values, they simply use the three values and (depending on the operation, of course) only output three values. You can also set the buffer length to 0 to have an unlimited buffer, which is perfectly fine for 95% of all applications - it just has a slightly slower implementation.

4. No, the current cycle cannot be read directly, but you can indeed count the cycles as you say. Be careful though: Cycle 0 can appear multiple times if the data "before starting the experiment" needs to be refreshed. So, you should probably set up a buffer of size 1 to keep track of the cycle and set it to 0 in cycle 0 while adding 1 in any other cycle (cycles="1-").