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

 
 

bug #66566: [octave forge] (signal) findpeaks.m: may miss peaks

Submitter:  Liang Tang <lt1234>
Submitted:  Sun 15 Dec 2024 06:32:48 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  None Assigned to:  None
Originator Name:  lt1234 Open/Closed:  * Open
Release:  * 9.2.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 15 Dec 2024 07:47:09 PM UTC, comment #2: 

I attached x.  You will find only one channel in x. The complete x contains hundred of channels.  With that, the x(:,17) in my earlier comment should change from x(:, 17) to x.

This x should be the same as the 'ydata' of children 2 of the gcf in any of the ofig. 

figure; plot([1:length(x)]*dt, x);
[tp, ind]=dat2tp(x); hold on;
plot(ind*dt, tp, 'ro');
title('WAFO dat2tp');
hgsave(gcf, 'wafo.ofig');
figure; plot([1:length(x)]*dt, x);
[PKS, LOC, EXTRA] = findpeaks(x,"DoubleSided"); hold on; plot(LOC*dt,PKS, 'ro');title('Octave findpeaks');
hgsave(gcf, 'octave.ofig');

(file #56695)

Liang Tang <lt1234>
Sun 15 Dec 2024 07:22:28 PM UTC, comment #1: 

Could you also attach "x"?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 15 Dec 2024 06:32:48 PM UTC, original submission:  

I was reading bug 66241 and decided to run a data on the findpeaks. 

The specific channel of data used is physically taken on a component.  It is chosen arbitrarily, not specific to trick findpeaks.  

Turning points are widely used in the industry, see nCode or LMS.  In matlab/octave domain, Wafo is a very well established code for fatigue estimation.  https://github.com/wafo-project/wafo

My understanding is that Octave peaks is the upper half side of the turning points. 

From the ofig, you can see that findpeaks misses peaks. 

To generate the ofig, (attached)

dt=1/fs=1.9531e-03.  x(:, 17) is in the ofig
 
figure; plot([1:length(x)]*dt, x(:,17));
[tp, ind]=dat2tp(x(:, 17)); hold on;
plot(ind*dt, tp, 'ro');
title('WAFO dat2tp');
hgsave(gcf, 'wafo.ofig');
figure; plot([1:length(x)]*dt, x(:,17));
[PKS, LOC, EXTRA] = findpeaks(x(:,17),"DoubleSided"); hold on; plot(LOC*dt,PKS, 'ro');title('Octave findpeaks');
hgsave(gcf, 'octave.ofig');

Liang Tang <lt1234>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #56695:  x.zip added by lt1234 (90KiB - application/x-zip-compressed)
file #56694:  octave.ofig added by lt1234 (820KiB - application/octet-stream)
file #56693:  wafo.ofig added by lt1234 (872KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by lt1234 (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 group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-12-15 lt1234 Attached File- Added x.zip, #56695
    2024-12-15 lt1234 Attached File- Added wafo.ofig, #56693
        Attached File- Added octave.ofig, #56694

    Back to the top

    Powered by Savane 3.14-708e.
    Corresponding source code