How to count peaks on chart in LabVIEW above some specific value. How to count amount of hills (Heart Rate Monitor)

Viewed 944

I want to create some simple heart rate monitor in LabVIEW.

I have sensor which gives me heart workflow (upper graph): Waveform

On second graph (lower graph) is amount of hills (0 - valley, 1 - hill) and that hills are heart beats (that is voltage waveform). From this I want to get amount of those hills, then multiply this number by 6 and I'll get heart rate per minute.

Measuring card I use: NI USB-6009.

Any idea how to do that?

I can sent a VI file if anyone will be able to help me.

2 Answers

You could use Threshold Peak Detector VI

This VI does not identify the locations or the amplitudes of peaks with great accuracy, but the VI does give an idea of where and how often a signal crosses above a certain threshold value.

You could also use Waveform Peak Detection VI

The Waveform Peak Detection VI operates like the array-based Peak Detector VI. The difference is that this VI's input is a waveform data type, and the VI has error cluster input and output terminals. Locations displays the output array of the peaks or valleys, which is still in terms of the indices of the input waveform. For example, if one element of Locations is 100, that means that there is a peak or valley located at index 100 in the data array of the input waveform. Figure 6 shows you a method for determining the times at which peaks or valleys occur.

NI have a great tutorial that should answer all your questions, it can be found here:

I had some fun recreating some of your exercise here. I simulated a squarewave. In my sample of the square wave, I know how many samples I have and the sampling frequency. As a result, I calculate how much time my data sample represents. I then count the number of positive edges in the sample. I do some division to calculate beats/second and multiplication for beats/minute. The sampling frequency, Fs, and number of samples, N or #s are required to calculate your beats per minute metric. Their uses are shown below.

The contrived VI

Does that lead you to a solution for your application?

Related