Path: news.mathworks.com!not-for-mail
From: "Pavle Boskoski" <pavleb@freemail.com.mk>
Newsgroups: comp.soft-sys.matlab
Subject: Re: local maxima lines:MATLAB CODE
Date: Sun, 11 May 2008 15:32:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 65
Message-ID: <g073hi$rre$1@fred.mathworks.com>
References: <1178277079.853382.320360@n59g2000hsh.googlegroups.com>
Reply-To: "Pavle Boskoski" <pavleb@freemail.com.mk>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210519922 28526 172.30.248.37 (11 May 2008 15:32:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 11 May 2008 15:32:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1382874
Xref: news.mathworks.com comp.soft-sys.matlab:467795


carlosmvmendes@gmail.com wrote in message
<1178277079.853382.320360@n59g2000hsh.googlegroups.com>...
> Hello!
> 
> Is there any Matlab function to obtain the local maxima lines?
> 
> Wavemenu in the wavelet toolbox does it but i can=B4t find
the actual
> Matlab command line function.
> 
> If that fucntion doesn=B4t exist in Matlab function, is
there any free
> available Matlab code to perform it?
> 
> Thanks in advance.
> 
> Carlos
> 


Here is some script that recreates the plot that you can see
from the wave menu:

% First generate the wavelet coefficients
% sig is your signal normal use of CWT command
r=cwt(sig,'haar',15000);

%clear some stuff if you run this over and over
clear coefs coefs_max coefs_fin;

indBeg = size(r,1);
scales = a_coefs;
coefs  = r;
%--------------------
[tmp,I1] = sort(scales);
[tmp,I2] = sort(I1);
coefs = coefs(I2,:);
coefs_max = localmax(coefs,indBeg); %localmax is a built-in
in wavelet toolbox
coefs_fin = coefs_max(I1,:);

clear coefs coefs_max;

% Prepare the plot
[nbRow,nbCol] = size(coefs_fin);
markersize = 2;
marker     = 'o';
linestyle  = 'none';
color      = wtbutils('colors','cw1d','spy');
x = [1:nbCol];

[iRow, iCol]= find(coefs_fin);


%Plot the maxima
plot(x(iCol),a_coefs(iRow), ...
   'marker',marker, ...
   'markersize',markersize, ...
   'linestyle',linestyle,   ...
   'color','r'); 


I hope this was the thing that you were looking for.

Pavle