I have a columm of values which is a read out of a sort of cardiogram. I can make a graph of this values.
I am looking for a method for easy (automatic) determination of all maximal points and all minimal points of this graph.
grafiek.JPG
I have a columm of values which is a read out of a sort of cardiogram. I can make a graph of this values.
I am looking for a method for easy (automatic) determination of all maximal points and all minimal points of this graph.
grafiek.JPG
I don't know that this kind of signal processing is every easy, but it certainly should be possible to make it automatic. I would expect a process similar to what I outlined in this thread (we never got into details: https://www.excelforum.com/excel-cha...m-a-chart.html ):
1) From calculus, I learned that minima/extrema tend to occur where the slope of a function is 0 or changes sign. So, one of the first things I usually do is to add a column to compute slope. (y2-y1)/(x2-x1) is usually good enough for noise free data, though I may choose different variations depending on noise and other considerations.
2) Then, a function to locate sign changes in the slope column. Something like =sign(a2)=sign(a1) will return TRUE if the signs are the same and FALSE if not.
3) The points you highlighted in your picture suggest that you are not looking for every minimum, but only certain minimum. I will usually add different columns for the different criteria that I will use to identify minima that I want to capture. This is often the most difficult part, because I have to think very carefully through the criteria I want to use (and how those criteria all combine together) to correctly identify the desired minima.
4) The result of all of that is usually a lookup column that I can apply a lookup function to (or a filter or similar) to extract the desired points. Can I assume you are familiar with Excel's lookup functions?
Your data shows some evidence of spurious, noise induced peaks/troughs, so you will need something in there to either avoid detecting those, or some way to ignore them. With the process broken up into general steps like that, where do you need help developing the algorithm you want?
Originally Posted by shg
Hi MrShorty,
Thanks for your fast reply. We are measuring the hartbeat. Maybe you have recognized the graph. We want to know the difference between every highest and lowest point of every beat. Measuring this from the graph takes to much time.
I am a user of excel and long time ago I have worked with VBA, but on to solve this problem …
Detecting the changing in slope is clear to me, but how do I manage to follow the whole curve automatic and detect all the points?
I have tried to attach the excelworkbook but for some reason this does not work today.
Hi, I'm not sure if this is going to be precise enough for you, however per the attached Column D tries to identify, courtesy of Boolean flag, the Max/Min points in each "sequence"; it uses the value in cell D1 {which can be altered} to determine how many points to look at either side of current record - i.e. how many would safely capture a sequence (negating temporary increases/descreases in larger sequence) -- in my example 20 points either side of current [where available].
note: I moved the chart only to allow for filtering of Column D, and comparison -- results look pretty aligned (to me), but I'm sure there are better, more sophisticated, solutions people have for this type of thing.
Thanks XLent, I will look at your solution. Anyway, it is a solution, until now I had nothing. I am looking for something that works for me. If it is complicated doesn't matter
Thanks again
Another one.
Playing around with the chart settings I settled on 85 as a good X boundary range that pairs each max with its min.
In E1 is a helper cell with the constant 85.
K2 and filled down this finds the maximums in each 85 cell range.and entered in L2 this finds the minimumsFormula:Please Login or Register to view this content.Formula:Please Login or Register to view this content.
In M1 this determines the rows where those maximums areIn N1 this returns the rows of the minimums.Formula:Please Login or Register to view this content.Formula:Please Login or Register to view this content.
In O2 and filled across column P returns the times(?) from column B.Formula:Please Login or Register to view this content.
Q2 is the difference between the maximums and minimums.Formula:Please Login or Register to view this content.
I left these same formula as array formulas in F2:J2 since I didn't know if you'd rather work with them directly. If you didn't already know it click in the formula bar and hit the F9 function key to see those arrays.
The formatting in C:D was to help me check my work. I left them in case it helps.
Hope this helps.
Dave
Hello FlameRetired,
It works !!!
It is more beautiful than I could imagine. This is just what I needed.
Now I am going to study how you did this. Of course I have to understand the method.
Thanks a lot, you have really helped me.
You're welcome. Glad to help. Thank you for the feedback.
Regarding the study. If you aren't already familiar with it besides the F9 function key be sure to notice and use the Evaluate formula feature (aka Fx) under the Formulas ribbon. These are good tools for analyzing formulas, trouble shooting and self instruction. I recommend them whenever I can.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks