0001 function [nextID, nextPP] = vb_find_local_peak(search_parm)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 Npoint = size(search_parm.nextIX,1);
0030 ID = zeros(Npoint,1);
0031 ID(search_parm.Iextract) = (1:length(search_parm.Iextract))';
0032
0033
0034 Pmax = max(search_parm.Pval);
0035 Pmin0 = Pmax*search_parm.minlevel;
0036 Vindx = search_parm.Iextract;
0037 Ptest = search_parm.Pval;
0038
0039 nextID = cell(search_parm.Npeak,1);
0040 nextPP = cell(search_parm.Npeak,1);
0041
0042 for n=1:Npeak,
0043
0044 [Pmax, maxix] = max(Ptest);
0045 Pmin = Pmax*search_parm.level;
0046 Pindx = Vindx(maxix);
0047 Pmin = max(Pmin,Pmin0);
0048
0049
0050 [nextix, nextP] = ...
0051 vb_find_neighbor_val(search_parm.Rmax,Pindx,Pmin,...
0052 search_parm.nextIX,search_parm.nextDD,...
0053 Ptest,Vindx);
0054
0055 nextID{n} = nextix;
0056 nextPP{n} = nextP;
0057
0058
0059 ID(nextix) = 0;
0060 ixz = ID( ID>0 );
0061 Vindx = search_parm.Iextract(ixz);
0062 Ptest = Pval(ixz);
0063 end;
0064