This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

How to shift buffers?
#1
Hello there,
I want to ask about some best practices for shifting buffer content.
My current implementation of such a buffer shift is a combination of append and subrange modules, is a little lengthy, and consumes probably too much power during the experiment.
The append module seems to add buffer values each time it is being executed, which would be more often than the (location) sensor delivers new data (approx. at 1 Hz); interestingly the append module seems to be slower that the linear acceleration sensor (approx. 208.9 Hz on my device).
To avoid an ever growing buffer (due to appending all the time) a subrange module needs to cut off the buffer in the frequency of new sensor data.

Buffer shift could be used for several things:
  • general usage is to construct buffers based on different sensors and based on own calculations in a way that they fit to each other for being displayed during the experiment and at the same time when exporting them (same buffer length which corresponding data at the same position for later reuse in OpenOffice or QGIS, for example), actually the export is the most important reason for juggling with the data this way
  • based on 3 GPS points (6 horizontal coordinates) my experiment calculates UTM coordinates and then the curvature radius for these 3 points and the lateral acceleration, for the overall calculation I use the append/subrange buffer build technique 15 times, yep, the mobile phone is getting warm during the experiment
  • to clock data from one sensor with the new data frequency of another sensor (currently I try to synchronize linear acceleration data with location data, which in principle works, but I don't see yet in an easy way some correlation between my additionally calculated data and the measured acceleration data, some puzzle piece still missing)
  • minor usage example: on my Android devices the location sensor sensor seems to start right away with a location even when before the firt GPS fix, I cut off this 0th location (this situation has been discussed within this thread)

In the attached example the lat buffer (size 0) is being counted and the third most recent position (size 1) is taken (subtract/subrange modules).
Then there is the append/subrange combination which feeds in their output as input for each other.
From what I understand currently this crossed reverse input would correspond to a sub-cycle resolution in the implementation which does not seem to be supported by the visual editor. This only works when I put these two module manually in the XML file in the correct order (subrange ahead of append). Yep, it might be that this technique will not work on each mobile device, but on mine it does.
The if condition is just to only output data if at least 3 GPS fixes are there and I have a set of 3 points to work on.
The subrange module then is to cut off the first buffer element which is an artifact by the append/subrange combination before.

If I'm not wrong some shift buffer module could do the job more easily. Such a module could have two inputs, the original buffer and the number of positions the original buffer should be shifted (+/-). It just might be like the append buffer with settings in which the position shift could be configured.
Or it might be just some shifting in the function module, where the (1st) input buffer is being refeneces as [1_], isn't it?
Some shifting could be configured as [1_(-1)] when using buffer [1] in the formular.
I outlined this just for giving these example and a better understanding of my intention.

Since I'm a new user of phyphox there is a lot I do not know, of course.
Maybe you already have something I could use for shifting buffers. Any idea welcome.
Thanks and kind regards, Trikes.


Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
How to shift buffers? - by Trikes - 06-24-2024, 09:14 AM
RE: How to shift buffers? - by Sebastian Staacks - 06-24-2024, 09:47 AM
RE: How to shift buffers? - by Trikes - 06-25-2024, 07:59 AM
RE: How to shift buffers? - by Sebastian Staacks - 06-25-2024, 09:16 AM
RE: How to shift buffers? - by Trikes - 06-27-2024, 08:54 AM
RE: How to shift buffers? - by Jens Noriʇzsɔɥ - 06-27-2024, 10:10 AM
RE: How to shift buffers? - by Sebastian Staacks - 06-28-2024, 12:53 PM
RE: How to shift buffers? - by Trikes - 06-29-2024, 09:28 AM
RE: How to shift buffers? - by Jens Noriʇzsɔɥ - 06-29-2024, 02:41 PM
RE: How to shift buffers? - by Trikes - 06-29-2024, 07:40 PM
RE: How to shift buffers? - by Sebastian Staacks - 06-30-2024, 02:55 PM
RE: How to shift buffers? - by Jens Noriʇzsɔɥ - 06-30-2024, 04:25 PM

Forum Jump: