LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA stable or new sampling frequency

Solved!
Go to solution

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

0 Kudos
Message 1 of 14
(4,359 Views)

If you can acquire a timestamp (or relative time) together with your measurements then you don't need a constant dt - you can use an XY Graph to display, and multiple arrays (or complex numbers) to hold the data set together with the time values.


GCentral
0 Kudos
Message 2 of 14
(4,356 Views)

Post your code and we can give advice.

Tim
GHSP
0 Kudos
Message 3 of 14
(4,353 Views)

How is it possible to acquire timestamp? Could you please show me any example? Here is my code.

0 Kudos
Message 4 of 14
(4,338 Views)
Solution
Accepted by dan23

Here's a simple modification:

visa_olimexv2_BD.png

 

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).


GCentral
Message 5 of 14
(4,328 Views)

Thank you very much, I will try it out. 

0 Kudos
Message 6 of 14
(4,321 Views)

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 🙂


GCentral
0 Kudos
Message 7 of 14
(4,314 Views)

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

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 8 of 14
(4,292 Views)

Thank you, I really appreciate these recommendations.  

0 Kudos
Message 9 of 14
(4,286 Views)

If I could ask you about one more question. How to calculate the sampling frequency/sample rate in this case?

0 Kudos
Message 10 of 14
(4,284 Views)