LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

respiratory rate

Well, your data is pretty clean so the derivative part can be left out. Just delete that function and connect through. You will have to adjust the filter inputs fh and fl to give you a clean signal (fl is used to remove the DC drift and fh filters out the high frequency noise). For your data fl = 0.005 and fh=0. Adjust your threshold to around 0.2 and the width to around 10.

This should give you the indices for all of the peaks.

FYI, the number fh and fl relate to the sampling frequency, fs. When that isn't connected, fs=1. So if your sampling frequency is 100 Hz and you fed this number into fs, then fl=100*0.005=0.5 Hz and fh=100*0.02=2 Hz
Randall Pursley
0 Kudos
Message 11 of 49
(2,071 Views)
Has Randall said, your data are clean, and there is no reason to obtain a negative value. I suspect some mistake not related to the algorithm functionality.
One thing you could do is to have a look at the values returned by the peek detect vi. This vi returns an array of indices, but you use only the two first values. Modify slightly your vi (by the way try to arrange it a bit...), to be able to read all the peak indices, as in the attached jpg, and tell us what the indices are. Try to compare with the actual peak positions.

CC
Chilly Charly    (aka CC)
Message 12 of 49
(1,856 Views)
For similar applications that I have had, I usually use the derivative function on the array of indices to get the difference between adjacent elements and those numbers can be converted from points to bpm.
Randall Pursley
0 Kudos
Message 13 of 49
(1,843 Views)
Hi Charlie,

I've tried what you said. Enclosed you can find the indices,saved data and screenshots.
0 Kudos
Message 14 of 49
(1,830 Views)
Here is the screen shot of front panel
0 Kudos
Message 15 of 49
(1,828 Views)
Here is the screen shot of diagram
0 Kudos
Message 16 of 49
(1,828 Views)
Here is the indices
0 Kudos
Message 17 of 49
(1,832 Views)
Sorry Burcu, but I don't understand what are Indices 1 and Indices 2. Indices should be a 1D-array, containing the same number of values than the number of peaks.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 18 of 49
(1,825 Views)
Try modifying how you handle the indices as attached. The results should be correct.

Also, I like to use the other peak detect function because it gives an output for the amplitudes of each so I can plot this with my original data to verify I am capturing all of the peaks and only the peaks.
Randall Pursley
0 Kudos
Message 19 of 49
(1,759 Views)
But indices are not 1-D array. I'm sending the .vi
0 Kudos
Message 20 of 49
(1,812 Views)