[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: findpeak -> peakdet.m ?
From: |
Olivier Crouzet |
Subject: |
Re: findpeak -> peakdet.m ? |
Date: |
Fri, 30 Mar 2012 12:41:10 +0200 |
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/
- Re: Reading mat file, (continued)
- Re: Reading mat file, Doug Stewart, 2012/03/21
- Re: Reading mat file, ahowe42, 2012/03/21
- Re: Reading mat file, Jordi Gutiérrez Hermoso, 2012/03/21
- findpeak, asha g, 2012/03/28
- findpeak, asha g, 2012/03/28
- Re: findpeak, Luke M, 2012/03/28
- Re: findpeak, asha g, 2012/03/29
- Re: findpeak, Luke M, 2012/03/29
- Re: findpeak -> peakdet.m ?, Olivier Crouzet, 2012/03/29
- Message not available
- Re: findpeak -> peakdet.m ?,
Olivier Crouzet <=
- Re: findpeak -> peakdet.m ?, asha g, 2012/03/31
- Message not available
- Re: findpeak -> peakdet.m ?, asha g, 2012/03/29
- Re: Reading mat file, asha g, 2012/03/21
- Re: Reading mat file, Mech.Mon, 2012/03/22
- Re: Reading mat file, Luke M, 2012/03/29
- Re: Reading mat file, asha g, 2012/03/30
- Re: Reading mat file, Luke M, 2012/03/31
- Re: Reading mat file, Doug Stewart, 2012/03/21