14,977,979 members
1.00/5 (1 vote)
See more:
Hey everybody

Im trying to design a program where i have to find the time between P and R in an ECG graph. Also called PR - Interval.

I have all the graph numbers in a list, so how can i do that easiest?

What I have tried:

i Have tried to create two new list one with all the P's and one with all the R's. But it seems like i cant get exactly the p's and r's from the original list with all the plots. So i need help for an algorithme
Posted
Updated 7-Apr-16 3:16am
CPallini 6-Apr-16 4:21am

You should tell us more about the info available in your list.
Tomas Takac 6-Apr-16 4:28am

Please show your code. It will be much easier to discuss it then.

Solution 1

Had to google to find out the basics about P and R waves but the University of Nottingham had some information on cardiology.... including all the peaks and troughs in an ECG (P-wave, QRS sequence and T wave)

The P Wave - Sinus Rhythm - Normal Function of the Heart - Cardiology Teaching Package - Practice Learning - Division of Nursing - The University of Nottingham[^]

From a mathematical perspective, it's just a graph with some peaks (maxima) at P and R.

From a programming perspective, if you've got this graph represented as data, you're looking for an algorithm that detects local minima and maxima (well, maxima if you want the time from P to R), or something that calculates gradient of the graph between data points, looking for a switch from positive gradient to negative (i.e. going over a peak and starting back down the other side.)

Okay - this isn't a solution per-se as I don't have an actual code to give in this instance, but Googling / Stack Overflowing for something on "c# gradient of graph" or "c# detect minima and maxima" might get you going.

Best of luck!