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

  • SEARCH
  • Home
  • 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 7846853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:43:47+00:00 2026-06-02T17:43:47+00:00

How to differentiate between a double peak and a single peak array? Also if

  • 0

enter image description here

How to differentiate between a double peak and a single peak array?

Also if the array represents a double peak, how to find the minimum point between two peaks? The minimum points outside of the peaks (left of left peak and right of right peak) should not be considered in finding the minimum point.

  • 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-06-02T17:43:48+00:00Added an answer on June 2, 2026 at 5:43 pm

    I found PEAKDET function to be quite reliable and fast although it’s loop based. It does not require pre-smoothing of noisy data, but finds local max and min extrema with difference larger than parameter delta.

    Since PEAKDET runs from left to right it sometime misses peaks on the right site. To avoid it I prefer to run it twice:

    %# some data
    n = 100;
    x = linspace(0,3*pi,n);
    y = sin(x) + rand(1,n)/5;
    
    %# run peakdet twice left-to-right and right-to-left
    delta = 0.5;
    [ymaxtab, ymintab] = peakdet(y, delta, x);
    [ymaxtab2, ymintab2] = peakdet(y(end:-1:1), delta, x(end:-1:1));
    ymaxtab = unique([ymaxtab; ymaxtab2],'rows');
    ymintab = unique([ymintab; ymintab2],'rows');
    
    %# plot the curve and show extreme points based on number of peaks
    plot(x,y)
    hold on
    if size(ymaxtab,1) == 2 && size(ymintab,1) == 1 %# if double peak
        plot(ymintab(:,1),ymintab(:,2),'r.','markersize',30)
    elseif size(ymaxtab,1) == 1 && size(ymintab,1) == 0 %# if single peak
        plot(ymaxtab(:,1),ymaxtab(:,2),'r.','markersize',30)
    else %# if more (or less)
        plot(ymintab(:,1),ymintab(:,2),'r.','markersize',30)
        plot(ymaxtab(:,1),ymaxtab(:,2),'r.','markersize',30)
    end
    hold off
    

    Two peaks example

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

Sidebar

Related Questions

I need to differentiate between a single click and a double click but I
I'm trying to use type hinting to differentiate between two single-arg methods. For example,
How can I differentiate between two local branches in git ? How can I
How to differentiate between two select new fields e.g. Description c.Description and lt.Description DataTable
I created some code to differentiate between two usergroups in Django admin, resulting in
I am using Google analytics and wish to differentiate between two different cases on
Even though Lua does not differentiate between floating point numbers and integers, there are
how do I differentiate between the two memory warning levels in didReceiveMemoryWarning ? Received
I'm trying to differentiate between two (or more) UITouch objects on the iPhone. Specifically,
How to differentiate between two items in the ListView Activity(Android)?? As i am creating

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.