bugGNU Octave - Bugs: bug #63987, [octave forge] (signal) findpeaks...


bug #63987: [octave forge] (signal) findpeaks mishandling flat valleys

Submitter:  John Wehle <jwehle>
Submitted:  Sat 01 Apr 2023 08:30:41 AM UTC
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  None Assigned to:  None
Originator Name:  John Wehle Open/Closed:  * Open
Release:  * 8.1.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Wed 24 May 2023 04:15:25 AM UTC, comment #3: 

No ocl Octave

Wed 10 May 2023 04:44:01 AM UTC, comment #2: 


  d = [1 10 2 2 1 9 1];
  [ pks, loc ] = findpeaks(d, 'MinPeakHeight', 2*sqrt(eps));

produces the same problem.

John Wehle <jwehle>
Tue 09 May 2023 10:44:07 AM UTC, comment #1: 

Do you get rid of the flat valley by adapting the value of the parameter "MinPeakHeight"?
Try to increase it to 2*sqrt(eps). Does it fix the issue?

Juan Pablo Carbajal <juanpi>
Group Member
Sat 01 Apr 2023 08:30:41 AM UTC, original submission:  

Matlab documentation says regarding findpeaks:

  returns a vector with the local maxima (peaks) of the input signal vector, data.  A local peak is a data sample that is either larger than its two neighboring samples or is equal to Inf.

Using Matlab online to run:

  d = [1 10 2 2 1 9 1];
  [ pks, loc ] = findpeaks(d);

gives the results:

  loc [2, 6]
  pks [10, 9]

However using GNU Octave 8.1 on Windows 10 produces:

  loc [2, 4, 6]
  pks [10, 2, 9]

Octave seems to be treating the flat valley as a peak.

John Wehle <jwehle>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by juanpi (Posted a comment)
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by jwehle (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.





    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-08 mmuetzel Summarysignal - findpeaks mishandling flat valleys [octave forge] (signal) findpeaks mishandling flat valleys

    Back to the top

    Powered by Savane 3.12