Posts: 4
Threads: 1
Joined: Oct 2024
10-31-2024, 05:47 AM
(This post was last modified: 10-31-2024, 06:30 PM by Newcomer.)
Hi
.This is the first time I have used Phyphox and I have some problems. Now I'm making a simple sensor that measures heart beat rate by acceleration without g(Y-Axis), the graph shows a peak of a graph like an electrocardiogram and we can count a peak of the graph and calculate to BPM
Ex.measure in 20s BPM = amount of peak x 3
And this is my question
1. how can count the amount of peak in the graph?. this is the first time and I don't know what blog or function can work. I'm guessing it is a threshold blog but I'm not sure it gonna work
2. Why does the graph not look the same in the app? It looks like it's not stable. I think I missed some setting or something.
=> After Trial and error just have 0hz no average
Posts: 547
Threads: 24
Joined: Apr 2020
Institution: RWTH Aachen University
10-31-2024, 09:27 PM
(This post was last modified: 10-31-2024, 09:28 PM by Jens Noriʇzsɔɥ.)
You could have a look at the “Motion Stopwatch” that has likely most of the functionality implemented (particularly, check the “many” tab). Personally, I would start with it and kick anything out that looks unneeded – and learn a lot doing that because Sebastian has included some magic…
Have you tried a rate of 100 Hz like in the original graph? It could be that you just miss the full height with a lower rate.
Posts: 4
Threads: 1
Joined: Oct 2024
11-01-2024, 07:52 AM
(This post was last modified: 11-01-2024, 07:52 AM by Newcomer.)
After I tried dissecting the code, it seemed complex and quite error-prone. So now, I'm attempting to do it in my way. Could you review my code and help me why it's not working? The issue seems to be with the if function count = count+1, and I'm wondering how to write it correctly in this style or simiar logic.
acc = input y, acct = input time and idk just need to use append or not
simple logic
count = 0
if y value > threshold(approximately 0.2) => count = count+1
BPM = count*3(measure in 20s)
Posts: 547
Threads: 24
Joined: Apr 2020
Institution: RWTH Aachen University
It would be much easier if you could simply copy the code into a text file and share it as an attachment. On append: it makes sense to rewatch the part on containers, “keep”, and “append” of the introductory video. The phyphox containers behave quite different to regular variables.
For debugging purposes, it makes sense to export the containers that you are working with and verify the data that you would expect is actually in there.
HTH a bit.
Posts: 4
Threads: 1
Joined: Oct 2024
this is my code without an if blog because it can't generate so I know that bug here now i didn't ✓ anything
you can see a if blog in previous pic
<phyphox xmlns="https://phyphox.org/xml" version="1.18">
<title>New Experiment</title>
<category>No Category</category>
<data-containers>
<container size="0">acc</container>
<container size="0">acct</container>
<container size="0">accCopy</container>
<container size="0">acctCopy</container>
<container size="0">max</container>
<container size="0">t</container>
<container size="0">count</container>
<container size="0">BPM</container>
</data-containers>
<input>
<sensor type="linear_acceleration">
<output component="y">acc</output>
<output component="t">acct</output>
</sensor>
</input>
<analysis>
<append>
<input>acc</input>
<output>accCopy</output>
</append>
<append>
<input>acct</input>
<output>acctCopy</output>
</append>
<max>
<input as="x">acctCopy</input>
<input as="y">accCopy</input>
<output as="max">max</output>
<output as="position">t</output>
</max>
<multiply>
<input>count</input>
<input type="value">3</input>
<output>BPM</output>
</multiply>
</analysis>
<views>
<view label="New View">
<graph label="New Graph">
<input axis="x">acct</input>
<input axis="y">acc</input>
</graph>
<value unit="BPM" label="your heart beat rate is">
<input>BPM</input>
</value>
</view>
</views>
</phyphox>
Posts: 4
Threads: 1
Joined: Oct 2024
11-01-2024, 06:35 PM
(This post was last modified: 11-01-2024, 08:01 PM by Newcomer.)
time zone gonna kill me, Up until now, I still don't know how to write. I still don't know the purpose of some blogs If anything is wrong, you know I'm just guessing.
Posts: 547
Threads: 24
Joined: Apr 2020
Institution: RWTH Aachen University
It's not so much the time difference but rather the federal holiday here today…
Posts: 547
Threads: 24
Joined: Apr 2020
Institution: RWTH Aachen University
Your project is rather ambitious for first steps with the editor. Perhaps it is a good idea to have an eye on the (technical) documentation of the file format in our wiki:
https://phyphox.org/wiki/index.php/Phyphox_file_format
Posts: 17
Threads: 2
Joined: Jun 2019
Institution: none
This sounds a biyt like the morse translator experiment that Sebastian wrote for me....
https://phyphox.org/forums/showthread.ph...ight=morse