help-octave
[Top][All Lists]
Advanced

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

Re: findpeak -> peakdet.m ?


From: asha g
Subject: Re: findpeak -> peakdet.m ?
Date: Sat, 31 Mar 2012 13:29:24 +0800 (SGT)

I have sent to the list but the messages with attachments do not go through.
Asha 
 
 
 
 
 

Hi,

please send directly to the list rather than to myself (I first did
this mistake yesterday when replying to your message but it's better to
answer the list).

On Fri, 30 Mar 2012 14:07:07 +0800 (SGT) asha g <address@hidden>
wrote:

> I have tried out this code and do not  get what I need. It is
> possible that I am not writing it correctly. I am attaching my data
> set and a plot for the same. Can you please run it and send me the
> values for  maxtab and mxpos.

Actually, as you do not explicitly state the commands you wrote, no one
can really understand what the issue is (but see the bottom of this
message for a guide).

>
> Also what you wrote as v, delta, x. 
> maxtab =
>
>    20.822   21.685
>    39.748   20.266
>
> octave3.2:5> mxpos
> mxpos =  55
> octave3.2:6> mintab
> mintab =
>
>    23.073  -56.384
>    41.991  -56.388
>
> octave3.2:7> minpos
> error: `minpos' undefined near line 7 column 1
> octave3.2:7> mnpos
> mnpos =  41.991
>
>
> This makes no sense as you can see from the plot.

Actually, the variable names you use do not make sense, so there's no
reason it should work as is. There's not reason why mxpos and
either minpos or mnpos should be defined. They probably come from other
commands you wrote but clearly not from the call to peakdet.m. Only
maxtab and mintab are defined (well... if you've given them these names
of course). This makes me suspect that perhaps you would need to learn
some basics of octave programming before you proceed farther but I may
be wrong...


I do (in octave):

load "cabunbact1aN11oct" # your octfile containing the data
plot(x,vv1);
[mymaxtab,mymintab] = peakdet(vv1,0.1,x);
hold on;
plot(mymaxtab(:,1),mymaxtab(:,2),'r*','markersize',8);
axis([0 55 -65 30]);
hold off;

mymaxtab is a matrix containing the positions (1st col) and the values
(2nd col) for the peaks. mintab is a matrix containing the positions
(1st col) and the values (2nd col) for the valleys (which may not be
relevant here).

There's one 'max value' clearly not relevant on the left. So I increase
the delta to 1 (it will depend on your y axis values and variation
scale).

plot(x,vv1);
[mymaxtab,mymintab] = peakdet(vv1,1,x);
hold on;
plot(mymaxtab(:,1),mymaxtab(:,2),'r*','markersize',8);
axis([0 55 -65 30]);
hold off;

and there you are.

Olivier.

--
  Olivier Crouzet, PhD
  Laboratoire de Linguistique -- EA3827
  Département de Sciences du Langage
  UFR Lettres et Langages
  Université de Nantes
  Chemin de la Censive du Tertre - BP 81227
  44312 Nantes cedex 3
  France

    phone:        (+33) 02 40 14 14 05 (lab.)
                  (+33) 02 40 14 14 36 (office)
    fax:          (+33) 02 40 14 13 27
    e-mail:      address@hidden
       
  http://www.lling.fr/
 
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave



reply via email to

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