+ Reply to Thread
Results 1 to 8 of 8

determine maximal and minimal values of a graph with more maximal and minimal points

  1. #1
    Registered User
    Join Date
    10-09-2018
    Location
    Vught
    MS-Off Ver
    Office 365
    Posts
    4

    determine maximal and minimal values of a graph with more maximal and minimal points

    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

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: determine maximal and minimal values of a graph with more maximal and minimal points

    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?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    10-09-2018
    Location
    Vught
    MS-Off Ver
    Office 365
    Posts
    4

    Re: determine maximal and minimal values of a graph with more maximal and minimal points

    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.
    Attached Files Attached Files

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: determine maximal and minimal values of a graph with more maximal and minimal points

    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.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-09-2018
    Location
    Vught
    MS-Off Ver
    Office 365
    Posts
    4

    Re: determine maximal and minimal values of a graph with more maximal and minimal points

    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

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: determine maximal and minimal values of a graph with more maximal and minimal points

    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.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and entered in L2 this finds the minimums
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In M1 this determines the rows where those maximums are
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In N1 this returns the rows of the minimums.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In O2 and filled across column P returns the times(?) from column B.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Q2 is the difference between the maximums and minimums.
    Formula: copy to clipboard
    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

  7. #7
    Registered User
    Join Date
    10-09-2018
    Location
    Vught
    MS-Off Ver
    Office 365
    Posts
    4

    Re: determine maximal and minimal values of a graph with more maximal and minimal points

    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.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: determine maximal and minimal values of a graph with more maximal and minimal points

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculate a chronological MAximal Drawdown
    By OlivierVE90 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-02-2016, 11:33 AM
  2. Permutation of values in matrix to get minimal cost
    By Morbyta in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-23-2015, 04:19 PM
  3. Find minimal value of two same values and reference corresponding cell???
    By kapanen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-02-2010, 05:01 PM
  4. Indicators for the maximal and minimal values
    By Hani Kashalo in forum Tips and Tutorials
    Replies: 3
    Last Post: 11-29-2006, 07:51 AM
  5. [SOLVED] how can I get the maximal used column in the specified row?
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2005, 06:05 PM
  6. Retrieving the Minimal / Maximal Values from a Filtered List
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-25-2005, 02:55 AM
  7. Finding the Maximal / Minimal String, Based on Alphabetic Order
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-25-2005, 02:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1