octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #39267] signal package: findpeaks: Error:subsc


From: Juan Pablo Carbajal
Subject: [Octave-bug-tracker] [bug #39267] signal package: findpeaks: Error:subscript indices must be either positive integers or logicals
Date: Thu, 20 Jun 2013 14:12:08 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36

Follow-up Comment #3, bug #39267 (project octave):

Hi,

Thanks, I have fixed it in the repository.

Anyways with the signal provided the sampling is too low to get all peaks.
Trying with the following works ok (remember that findpeaks uses a rough
estimates of first and second derivative, you will need to tune parameters to
get good results).

    t = linspace(0,400,1e3)';
    y1 = sin(2*pi*f1/fs*t); 
    y2 = sin(2*pi*f2/fs*t); 
    data1 = 2 + (0.2*y1 + y2); 
    [pks idx] = findpeaks(data1);
    plot (data1,'-',idx,pks,'o')


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39267>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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