Identify and chain local maxima
[lmaxima,indices]
= localmax(inputmatrix)
[lmaxima,indices]
= localmax(inputmatrix,initrow)
[lmaxima,indices]
= localmax(inputmatrix,initrow,regflag)
[
identifies
and chains the local maxima in the rows of lmaxima
,indices
]
= localmax(inputmatrix
)inputmatrix
.
[
initializes
the chaining of local maxima beginning with row lmaxima
,indices
]
= localmax(inputmatrix
,initrow
)initrow
.
If there are no local maxima in initrow
, all
rows in lmaxima
with indices less than initrow
consist
of only zeros.
[
replaces lmaxima
,indices
]
= localmax(inputmatrix
,initrow
,regflag
)initrow
of inputmatrix
with
the level5 approximation (scaling) coefficients obtained with the sym4
wavelet.



Initialization row for chaining local maxima. The chaining algorithm
begins at Default: 

Regularization flag. If you set Default: 

Matrix with local maxima chains.


Linear indices of the nonzero values of 
Construct a 4by4 matrix with local maxima at the following
rowcolumn indices: (4,2), (3,3), (2,2), and (1,3). Set initrow
to
4 and regflag
to false
.
inputmatrix = ...
[3 2 5 3
4 6 3 2
4 4 7 4
4 6 2 2];
[lmaxima,indices] = localmax(inputmatrix,4,false);
lmaxima
Because localmax
operates on the absolute
values of inputmatrix
, setting inputmatrix(4,2)
= inputmatrix(4,2)
produces an identical lmaxima
.
inputmatrix(4,2) = inputmatrix(4,2); [lmaxima1,indices1] = localmax(inputmatrix,4,false); isequal(lmaxima,lmaxima1)
Determine the local maxima from the CWT of the cuspamax
signal using the default Morse wavelet. Plot the CWT coefficient moduli and maxima lines.
load cuspamax;
Plot the cuspamax
signal and notice the shape of the signal near samples 300 and 700. The signal shows a cusp near sample 700.
plot(cuspamax);
xlabel('Sample');
Plot the wavelet transform modulus maxima and note the local Holder exponent values at samples 308 and 717.
wtmm(cuspamax,'ScalingExponent','local');
Holder exponent values indicate the strength of the singularities in a signal. Signal locations where the local Holder exponent is 0 are discontinuous at that location. Locations with Holder exponenets greater than or equal to 1 are differentiable. Holder exponent values less than but close to 1 indicate that the signal at the location is almost differentiable. The closer the Holder exponent value is to 0, the stronger the singularity.
The Holder exponent at sample 308 is 1.9 and at sample 717 is 0.39. The low Holder value at sample 717 confirms that the signal is not differentiable and has a fairly strong singularity at that point.