LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calculating beat per minute

Hello,
I wrote a multichannel data acquisition code including Respiration ,ECG and GSR (Galvanic Skin Response). I want to calculate beat per minute and breathing rate. I�ve used a threshold peak detector. I�ve thought that the difference of the index of the first peak and th index of the second peak generates the number of total samples between two consecutive counts. To count the beat rate per second I divided sample rate by the number of samples per beat. Then I�ve multiplied beat rate per second by 60 to generate beat rate per minute. I also did the same thing for breath rate per minute.
The problem is the result wasn�t successful. As you can see in the attachment I�ve calculated bpm as 253 and brpm is 538. BPM should be
60 for a healthy person and BRPM should be 15.
Ther is nothing wrong with my signals. But as you can see in the diagram data comes as #4 and difference between index of the first peak and the index of the second peak is quite high.
What do you recommend me to do to calculate the correct values.
Thanks
Download All
0 Kudos
Message 1 of 20
(5,513 Views)
From the data that you provided, the sampling rate was 111 x 3.96 = 439.56 pts/s ! Interesting...

Then, the average beat rate was 36, while the breath rate was 30. What kind of a freak are you monitoring ? :-))

From the aspect of your diagram, may I suggest you to tidy up things a bit, then you will probably discover that somewhere you didn't connect the proper wire to the proper place 😉

Sherlock
Chilly Charly    (aka CC)
Message 2 of 20
(5,513 Views)
I have gone through your previous posts.
Now I understand the 44O Hz sampling rate. However, since there is apparently something wrong with your time axis, you should verify wether this is the rate you asked for or the actual sampling rate.

In order to facilitate our help, you should do two things :
1/ post your vi
2/ post a sample of your results as text file.
Chilly Charly    (aka CC)
Message 3 of 20
(5,513 Views)
Would you please send your e-mail adress. I use adac daq card. Thus, I can send my vi, text file and adac library to that adress.
Best regards.
0 Kudos
Message 4 of 20
(5,513 Views)
We'll do it the other way round : post your adress, then I'll answer... 🙂
CC
Chilly Charly    (aka CC)
Message 5 of 20
(5,513 Views)
my e-mail adress is bacar@boun.edu.tr
0 Kudos
Message 6 of 20
(5,512 Views)
Anyway, I'm sending the vi and txt file attached. I wanted your e-mail adress because the size of the ADAC driver and library is big for discussion forum. However, you can find the files below at www.iotech.com/ftp.html web site under ADAC products Windows95/98/ME in order to run my vi.
-Labview Support 2,3 MB
-Driver Support 379 KB
Thanks
Download All
0 Kudos
Message 7 of 20
(5,512 Views)
Nothing wrong with your wiring, but see point B below.

A/ The recorded ECG data do not show the periodic peaks that are displayed on your front panel. Instead, there is a single large peak toward the record end, exceeding the maximal value returned by the DAQ card. The noise amplitude is also much higher than on the front panel.
Could you send me a better file record ?

B/ What you are doing is :
1/ launch an acquisition with the "adaq acquire wave forms" (means wait for 1300 samples to be acquired, at 440 Hz = 2.954 s)
2/ process the data : plot, build data string, add FAKED time info (process time, not acquisition time, should be out of the For loop (same for the marker control)), save to disk
3/ return to step 1

Of course, step 2 takes some time (variable, depending on system/disk performance). I did some timing on my PC (resonably fast), and I have a 0.1 s delay. Not sure if this is critical for your work, but what you should do is to run TWO separate loops : one for data acquisition, with a continuous acquire waveform and one for data processing and disk recording.

CC
Chilly Charly    (aka CC)
Message 8 of 20
(5,512 Views)
Thanks for your response, I'm going to send you a better record .
0.1 s delay is not important for me. Would you please send me the screen shot or the vi with two seperate loops. I couldn't understand how to connect two seperate loops.

Best Regards
0 Kudos
Message 9 of 20
(5,512 Views)
Have a look on the attached vi.
The first loop runs in 1 second, generating an array of 100 random numbers;
The second loop calculates the sum of the array elements, and would run every 0.2 seconds.
Except that the occurence nodes synchronize the calculation with the availability of the data array.
You can experiment the effect of occurence by removing the nodes : the vi still runs, but the led blinks 5 times more rapidly.
Last comment : don't forget the ultimate set occurence when exciting the first loop, otherwise the second loop will wait for ever...

Ask if you need more help.

CC
Chilly Charly    (aka CC)
Message 10 of 20
(5,512 Views)