help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: findpeaks.m bug


From: Juan Pablo Carbajal
Subject: Re: findpeaks.m bug
Date: Wed, 18 Dec 2013 14:54:16 +0100

Please keep the Octave community in copy when you report issues with GNU Octave functions.
I do not understadn what you are saying about diff, try the following example
t = linspace(0,1,1000)';
x = sin(2*pi*t);
y=2*pi*cos(2*pi*t); # time derivative of x
z=-(2*pi).^2*sin(2*pi*t); # second time derivative of x
dt=t(2)-t(1);
h=plot(t,[y z],'k-', t, [0; diff(x,1)]/dt,'g.', t, [0;0; diff(x,2)]/dt^2,'r.');
set(h(1:2),"linewidth",8)

As you see diff(x,2) approximates the second derivative, not the difference of elements with lag 2. You can propose you own checks.

If findpeaks is not working for you trying setting the parameters to fit your data. Also, are you using findpeaks from the repository? there were several bugs fixes in that one.
http://sourceforge.net/p/octave/signal/ci/tip/tree/inst/findpeaks.m

Let me know if you have problems.





On Wed, Dec 18, 2013 at 2:32 PM, Josef Fruehwald <address@hidden> wrote:
Hi Juan,

I'm using findpeaks.m in the signal package, and it looks like it's severely broken. According to the comments, df2 is supposed to be the second derivative of the data, but it's not. It's just the diff taken at a lag of 2. As such, findpeaks just isn't doing what it's supposed to do.

-Joe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]