From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating BPM using either Peak Detection point by point or FFT

Hi Guys

 

Im new to Labview and have absolutely no idea on programming and stuff. Im doing a project on Heart Rate monitor.

 

I'm using labview to read the analog input to an Arduino Mini. In my attached VI im using Peak Detection Point by point to calculate the BPM but it doesnt seem to work. I took references from several VIs to arrive at my VI. 

 

My instructor told me I could try using FFT to calculate the BPM as well but Im not sure how to carry it out in Labview.

 

Hope you guys can help me with this.

 

Thanks alot!

Download All
0 Kudos
Message 1 of 2
(3,325 Views)

Ok, we have some problems here.

 

1.  The Data Bits property is the number bits for a single character that is being transmitted.  You should not use that.  Since you are using an Arduino, it should be sending the termination character.  So just tell the VISA Read to read maximum number of bytes you expect from a single message or just some large number (like 25).  The VISA Read will stop reading the port when it encounters the termination character.

2. The String Subset is not doing anything.  Just remove it.

3.  You should move your  Wait to be outside of the case structure.  As is currently written, if you are not taking readings you will use up all of your CPU.

4.  You should have labels for all of your controls and indicators.

5.  Your time calculation is completely wrong.  You want to subtract the time of the previous peak from the current peak.  I recommend you use a Feedback Node to do this.

 

Here's a slightly cleaned up version of your code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(3,291 Views)