+ Reply to Thread
Results 1 to 10 of 10

Determining Data Peaks & Valleys In Data

  1. #1
    Registered User
    Join Date
    08-23-2021
    Location
    New England
    MS-Off Ver
    Office 2021 Professional
    Posts
    16

    Determining Data Peaks & Valleys In Data

    Problem Statements (Please refer to attached spreadsheet.
    I've been going around in circles for days on this issue. This may help others derive more value form their data. Thank you in advance.

    A) Column B contains my numbers smoothed using a custom Savitzky-Golay filter. My graph shows the smoothed results.

    B) I believe Method 1 - Columns C & D - does a better job of identifying valleys and peaks but it is not accurate either.

    C) Issue: The formulas used in Method 1 require that an average be calculated in row 1989. Method 1 isn't accurate either

    D) Data is constantly being added in my case, so I can’t "look ahead" as Method 1 requires and use a average that changes.

    E) I want to calculate peaks and valleys in separate columns so I can graph them as 2 different lines

    F) Columns F and G use slope and the suggested separate formulas, but the results do not match up with Method 1.

    G) Visual inspection tells me Method 1 is more accurate but not entirely correct. In column B I highlighted a few numbers of Red.

    H) I'd love to be able to omit minor peaks and valleys, identified by Methods 1 and 2.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Determining Data Peaks & Valleys In Data

    No workbook attached.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    08-23-2021
    Location
    New England
    MS-Off Ver
    Office 2021 Professional
    Posts
    16

    Re: Determining Data Peaks & Valleys In Data

    Very sorry for not including the attachment.

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

    Re: Determining Data Peaks & Valleys In Data

    Re: C and D -- What alternatives to the overall average could you use? We could throw out possibilities, but I'm not sure we can make this decision for you. One possibility I see is that, because the smoothed data jumps above and below 0, I expect the overall average will always be near 0, so just use 0 instead of the average. But, I don't know if that fits into the overall algorithm that you are implementing.

    Re: G -- I didn't fully understand the red highlighted values. If I assume that you intended those points to be highlighted and they weren't highlighted, then I would say that they failed one or more of the tests columns C and D (some represented local minima above the average, others were local maxima below the average, others were "flat" where two adjacent points were neither larger nor smaller). If peaks/valleys are being missed, it is because the current logic does not capture those values, and we would first need to understand how you want to change the logic before we can talk about programming the new logic into the spreadsheet.

    Re: H -- No ideas, but the discussion probably needs to start by understanding what you mean by "minor" peaks and valleys. Then we can start talking about additional logic tests to filter out "minor" points.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    08-23-2021
    Location
    New England
    MS-Off Ver
    Office 2021 Professional
    Posts
    16

    Re: Determining Data Peaks & Valleys In Data

    Very astute observations. The figures come close to averaging 0 in this case. Other tests vary.
    The red numbers were manually added to help me see where the real peaks and valleys were compared to the formulas.
    Right now, I'd just be happy to identify peaks and valleys. From there I could add mathematical rules to remove slight spikes.
    Thank you.

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

    Re: Determining Data Peaks & Valleys In Data

    The figures come close to averaging 0 in this case. Other tests vary.
    Even so, could you choose the "average" or baseline beforehand? Or are you required to determine the "average" baseline value at runtime?

    The red numbers were manually added to help me see where the real peaks and valleys were compared to the formulas.
    The current logic for choosing a max (min) is "is the current value greater than (less than) both the value immediately before and immediately after, and is the value larger than (smaller than) the baseline average". Could you maybe walk us through a couple of the highlighted examples and explain why you highlighted them and compare that the current logic algorithm?

    I would also note at this point that I'm not necessarily worrying about exact spreadsheet formulas or anything. It feels to me like we are still exploring the more generic signal processing ideas (independent of the programming language you want to use), so I'm just trying to understand how you want to identify peaks and valleys.

  7. #7
    Registered User
    Join Date
    08-23-2021
    Location
    New England
    MS-Off Ver
    Office 2021 Professional
    Posts
    16

    Re: Determining Data Peaks & Valleys In Data

    This is an academic exercise - not related to student grade. I'm 76 years old and left college many years ago. I'm doing some very early analysis for a professor in Greater Boston.

    I can test the idea of averaging the baseline up to each point. Before doing that it may be advisable to see if there are any alternative formula approaches.

    I'm mainly interested if the trend of the extreme peaks and valleys to see where these swings in centigrade temperature are about to change direction. I read somewhere that the guys in the stock market look at trend the same way.
    Last edited by Goodsport; 01-13-2022 at 06:59 PM.

  8. #8
    Registered User
    Join Date
    08-23-2021
    Location
    New England
    MS-Off Ver
    Office 2021 Professional
    Posts
    16

    Re: Determining Data Peaks & Valleys In Data

    I'm a heat transfer guy not an Excel guru but Excel can really help here. I checked with the professor and added a bit more detail on what we are trying to do. I added descriptive notes and trend lines. The little "Explosions" show where I started to stress the energy absorption characteristics of each metal being tested. Thank you again for your help and suggestions..
    Attached Files Attached Files

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

    Re: Determining Data Peaks & Valleys In Data

    I'm still not sure exactly what we are trying to do here.

    In my own experimental work (completely different field that does not involve very much signal processing), I find that signal processing often wants clear "start of experiment" and "end of experiement" indicators in the data. In this case, are you expected (among other things) to identify start and end of experiment from the signal data, or are there other indicators outside of the data? You mention "24 hour cycles", but also that the data does not include any internal time indication. Would it be important to identify these 24 hour cycles, or, again, are you expected to identify 24 hour cycles from the raw data itself? You mention the existence of "stress points" but, again, there doesn't seem to be anything embedded in the raw data to tell us where the stress points occur.

    In short, it seems like there is more information about the signal that is not present in the signal data that could be important in processing the signal data.

    As far as the basic peak/valley identification, the current algorithm seems to work just fine -- I'm still not sure what you want to do differently about the "missed" peaks/valleys. My best guess is that the current algorithm "misses" peaks above/valleys below the "average" or "baseline" and that appears to be intentional. The current algorithm also assumes that peaks/valleys will be one data point wide and is not coded to handle cases where the peak/valley consists of two or more consecutive points with the same value. Am I understanding correctly, or is there more that I am missing?

  10. #10
    Registered User
    Join Date
    08-23-2021
    Location
    New England
    MS-Off Ver
    Office 2021 Professional
    Posts
    16

    Re: Determining Data Peaks & Valleys In Data - Solved

    I was trying to make things more difficult than they had to be. Thanks for the push back. I looked back 3 periods and ahead 3 periods, and also prevented it from looking beyond the data. I can now go back and see how the variables behaved at key turning points once we stopped heating and cooling the materials.
    Thank you very much. Also updated the file. Case closed.
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 12-04-2019, 11:20 AM
  2. List number of graph peaks/valleys?
    By QuantEdge in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-29-2017, 03:08 PM
  3. How do Identify MAX and MIN Peaks in a Set of Data
    By claudioasn in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-26-2015, 11:01 AM
  4. Replies: 5
    Last Post: 05-16-2012, 11:52 AM
  5. [SOLVED] How to find multiple peaks in a data set
    By willevans in forum Excel General
    Replies: 9
    Last Post: 03-29-2012, 06:37 AM
  6. Replies: 1
    Last Post: 11-02-2009, 09:00 AM
  7. Identifying Peaks in Data
    By SportsScientist in forum Excel General
    Replies: 11
    Last Post: 05-06-2009, 07:25 AM

Tags for this Thread

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