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: 

stabile peak detector for ECG

It´s still very strange...

 

the cycle won´t stop - that´s the problem. The condition:

 

while threshold>max wont stop the cycle... when I stop the cycle after XXX cycles I get result: 2D array with  00000000;0,762 0,762 0,762 etc...

0 Kudos
Message 11 of 17
(1,136 Views)

The standard Peak Detector.vi works fine.  I made no attempt to automatically calculate the threshold. ECG signals vary so much that doing so can be a major challenge.  For your data thresholds between about 0.27 and 0.47 may work.

 

Because there are small variations near some of the peaks in your data set, it is necessary to increase the width parameter for the peak detector. I found that a value of 6 seems to work well with your data.

 

It can be very useful to put a graph on your front panel while investigating the best options. By visualizing the data you may be able to pick out things that you would never think of otherwise. For example set the width to 3 in my VI, you will see that it "finds" 4 extra peaks. Note where the locations are close together, such as 3586 and 3587.  Then expand the graph to see the data in that region.  The little bump at 3590-91 is detected as a peak with the width = 3 but with the width = 6 it interprets that as just one peak.

 

Lynn

 

ECG Peak.png

Message 12 of 17
(1,109 Views)
Johnsold,
we know that vi but problem here is that our friend do not have signal processing toolkit
Imedex,
did you test my last vi that I attach it seem it could help a problem Bit
0 Kudos
Message 13 of 17
(1,094 Views)

That VI is part of the standard LV package in the Full Development System or higher. It does not require the signal processing toolkit.

 

I could not get your VI to work with the data he posted.  The VI would never stop. I did not look closely but I think the stop logic may have a flaw. Try running it on his data with Highlight Execution turned on. After the second or third iteration nothing ever changes.

 

Lynn

0 Kudos
Message 14 of 17
(1,084 Views)

HI gain

As i confess before unfortunately I do not test it before send because I do not had ECG signal 
after i found  ECG signal I got that there is bug in my code and so I change it 
did you test my second vi that I send bellow of that post?
It work  a Bit Smiley Happy
but If you chase our previous chats 
also I recommend some free toolkit but 
the user do not want use signal processing tool In LV
so I try to make my own code 

0 Kudos
Message 15 of 17
(1,071 Views)

Thank you for your advices.

 

The problem is - in labview 2014 is biomedical toolkit for free, but you need advance signal processing toolbox and that one is not for FREE. I do not have so. So I got only 3 day left from evaluation period...

 

I tried the second one VI, but I get the same error: cycle won´t stop.

 

And about the standard peak detector - it work just fine, but only for the signal with positive peaks. When its negative or positive/negative or with big T wave -  😞 I wanted to use toolkit but I get error with "ecg extraction.vi" about sampling frequency.

 

I´m pretty sure I got 1kHz sampling frequency, but I can´t apply any of filter (for example highpass from 20Hz+) because of error with ... 0>=fs<hight<sampF/2 ... I believe its Nyquist theorema. But it doesn´t make any sense to me.

 

All I need is "rape" the ecg signal to looks always the same for my "trivial" peak detector. But I DO NOT KNOW how 😕

0 Kudos
Message 16 of 17
(1,039 Views)

To get the negative peaks place a second copy of Peak Detector.vi and wire a "Valleys" constant to the peaks/valleys input. A threshold of -0.3 works with the data you posted earlier.

 

Lynn

0 Kudos
Message 17 of 17
(1,008 Views)