Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7437391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:23:35+00:00 2026-05-29T10:23:35+00:00

I essentially have a bunch of data objects which map timestamps in milliseconds to

  • 0

I essentially have a bunch of data objects which map timestamps in milliseconds to float values. I’m looking to essentially find the peak/max of the data in a given range. I’ve been essentially using something like this:

float previousValue = 0;
for (int i = 0; i < data.size(); i++) {
    MyData value = data.get(i);
    if (value.getData() < previousValue) {
        // found the peak!
        break;
    } else {
        previousValue = value.getData();
    }
}

The only problem with this algorithm is that it doesn’t account for noise. Essentially, I could have values like this:

[0.1025, 0.3000, 0.3025, 0.3500, 0.3475, 0.3525, 0.1025]

The actual peak is at 0.3525, but my algorithm above would see it as 0.3500, as it comes first. Due to the nature of my calculations, I can’t just do max() on the array and find out the largest value, I need to find the largest value that comes first before it falls.

How can I find the top of my peak, while accounting for some variance in noise?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:23:36+00:00Added an answer on May 29, 2026 at 10:23 am

    There are two issues:

    1. filtering out the noise;
    2. finding the peak.

    It seems like you already have a solution for 2, and need to solve 1.

    To filter out the noise, you need some kind of low-pass filter. A moving average is one such filter. For example, exponential moving average is very easy to implement and should work well.

    In summary: put your series through the filter, and then apply the peak finding algorithm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table schema which is essentially a bunch of transaction info with
I have a class which is essentially just holds a bunch of constant definitions
I have a gem which is essentially just a bunch of ActiveRecord::Base classes in
We have a bunch junit tests in our current project. Essentially we are looking
Essentially I have a method of a class called killProgram, which is intended to
In an application I'm working on, I have what are essentially a bunch of
I have a bunch of data coming in (calls to an automated callcenter) about
Assuming I have a bunch of timestamps like 11/05/2010 16:27:26.003, how do parse them
If you have to use String.Replace() to replace test 50 times, you essentially have
I have essentially a survey that is shown, and people answer questions a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.