function vme = meanMaxScW(v, wl, wm, stepwl, percmi,percma) % --------------------------------------------------------------------------------------------- % meanMaxScW.m: Compute the average value of the maxima on data windows of the input vector. % --------------------------------------------------------------------------------------------- % Compute the mean values of the maxima of signal values in subwindows of a sliding window % The distribution tails can be excluded. % vme = meaMaxScW(v,wl,wm,stepwl,perci,percf) % v = signal vector % wl = width of the sliding window % wm = width of the subwindows % stepwl = sliding window step % perci = % of min values to be excluded % percf = % of max values to be excluded % % --------------------------------------------------------------------------------------------- % Maurizio Varanini, Clinical Physiology Institute, CNR, Pisa, Italy % For any comment or bug report, please send e-mail to: maurizio.varanini@ifc.cnr.it % --------------------------------------------------------------------------------------------- if(nargin<4), stepwl=1; end if(nargin<5), percmi=5; end if(nargin<6), percma=percmi; end if nargin==0, meanMaxScW_test; return; end if(percmi<0 || percma<0 || (percmi+percma)>=100), fprintf('\n"meanMaxScW": error in input parameters\n'); pause; end if(stepwl<1), stepwl=1; end if(isempty(v)), vme=[]; return; end [nt,dummy]=size(v); if(nt