01-30-2020 10:54 AM
Hello,
I acquire an ECG signal using the Arduino Uno and VISA. The problem is that the sampling frequency is not stable so I cannot define the time axis for the RR interval acquisition. Is there any other way how to set a new sampling frequency or how to stabilize the original one? The sample rate is around 95 S/s. Is it 9600/1024?
Thank you,
Dan
Solved! Go to Solution.
01-30-2020 10:56 AM
01-30-2020 10:58 AM
Post your code and we can give advice.
01-30-2020 11:02 AM
How is it possible to acquire timestamp? Could you please show me any example? Here is my code.
01-30-2020 11:08 AM
Here's a simple modification:
I added a Re/Im to Complex node, and changed the representation of your shift register value, then replaced the waveform chart with an XY graph.
Note that this is recording the time you receive the data - not the time the data was measured!
If this distinction is important (it may well be) you'll need to try and acquire the time on the Arduino and transmit pairs of data (time and value).
01-30-2020 11:14 AM
Thank you very much, I will try it out.
01-30-2020 11:17 AM
Just in case you don't know, the image I posted is a VI Snippet and should be possible to drag onto a block diagram to place the code.
That being said, it's only a small modification to the code you uploaded, and the forums + snippet system can be a bit fiddly (can't drag directly from the browser anymore, need to download, then fiddle with windows above and below... urgh.)
But in general, you can see the snippets by the outline, and they can be useful if it isn't basically just the code you already have 🙂
01-30-2020 12:14 PM
One small recommendation if you use the approach in cbutcher's snippet and timestamp your *receipt* of the message:
Use some sequencing method (this is one decent place for a single frame sequence structure) to make sure you query your timestamp immediately *after* returning from the VISA Read. That'll do a better job of capturing the receipt time. But realize that his caveat still holds true -- timestamping the receipt is still less true than timestamping at the source.
(I was gonna modify in place, but although the snippet was labelled 2015, my attempts to drag it into 2016 failed, identifying it as a 2019 snippet?)
-Kevin P
01-30-2020 12:28 PM
Thank you, I really appreciate these recommendations.
01-30-2020 12:40 PM
If I could ask you about one more question. How to calculate the sampling frequency/sample rate in this case?