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.

Bug in "average"
#1
I'm happily using phyphox for measuring and visualising all kinds of movement (skiing, driving by car ...). I just entered the Neuland of the editor for new experiments and I believe I found a bug: If I want to calculate a standard deviation without the corresponding average, the output strangely shows negative numbers. It turned out that I had do connect the "average" output as well to only receive positive standard deviations.

The following experiment shows standard deviations of the pressure in the order of 1bar:

Code:
<phyphox version="1.6" locale="en">
    <title>average_test</title>
    <category>no category</category>
    <description></description>
    <data-containers>
        <container size="100" static="false">t</container>
        <container size="100" static="false">x</container>
        <container size="0" static="false">average</container>
        <container size="0" static="false">stddev</container>
    </data-containers>
    <input>
        <sensor rate="1" average="false" type="pressure">
            <output component="x">x</output>
            <output component="t">t</output>
        </sensor>
    </input>
    <output>
    </output>
    <analysis sleep="0"  onUserInput="false">
        <average>
            <input as="buffer">t</input>
            <output as="average" clear="false">average</output>
        </average>
        <average>
            <input as="buffer">x</input>
            <output as="stddev" clear="false">stddev</output>
        </average>
    </analysis>
    <views>
        <view label="New view">
            <graph label="stddev(p)" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="s" labelY="hPa" logX="false" logY="false" xPrecision="3" yPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" minX="0" maxX="0" minY="0" maxY="0">
                <input axis="y">stddev</input>
                <input axis="x">average</input>
            </graph>
        </view>
    </views>
    <export>
    </export>
</phyphox>
Reply
#2
Thanks for reporting this. This indeed is a bug. The module does not verify that the output is present and derails before writing the stddev output. Will fix this with the next update.
Reply
#3
I might have found something in "max" as well, but maybe this is just a case of "it's your own fault": Wanting to find the maximum of an x-component of a sensor, I stubbornly conncted it to the x-input of "max", leaving the y-input open. This consistently leads to a crash. It's great to get a message from phyphox when trying to load a file with obvious bugs (such as unconnected views or unused sensors), so maybe this could be on the "obvious"-list.
Reply
#4
Yes, it should be on the obvious list Smile The max module always needs y values and looks for the maximum in there. The x is optional. If given, the corresponding x for the maximum y value is returned as well. So, if you want to find the max in a series of values, you need to connect it to y, even if you use those values as x in another context.

Are you trying your phyphox-files on iOS?
On Android, there should be a (more or less comprehensible) error instead of a crash. On iOS, the current parser tends to crash the entire app (which on iOS simply means that the app closes). The good news is, that the parser on iOS has already been entirely rewritten and will be released with version 1.1.0. With that version, you should get precise errors on iOS.
Reply


Forum Jump: