relopfabric.blogg.se

Textra
Textra





textra

% Sorting of local minimum and maximum points textra = zeros(1,length(tmin)+length(tmax)) xextra = zeros(1,length(xmin)+length(xmax)) if tmin(1) tmax(end) % The last extreme point is the minimum point textra(1) = tmin(1) xextra(1) = xmin(1) for i = 1:length(tmax) textra(2*i) = tmax(i) textra(2*i+1) = tmin(i+1) xextra(2*i) = xmax(i) xextra(2*i+1) = xmin(i+1) end else % The last extreme point is the maximum point for i = 1:length(tmax) textra(2*i-1) = tmin(i) textra(2*i) = tmax(i) xextra(2*i-1) = xmin(i) xextra(2*i) = xmax(i) end end else % The first extreme point is the maximum point if tmin(end) = 1 & (i-j) dtmp(i) dtmp(i) = tmp end end end end d = dtmp end Tmin = indmin tmax = indmax xmin = x(tmin) % The magnitude of the local minimum point xmax = x(tmax) % The magnitude of the local maximum point = extreme_points(x) % Determine the location of local minima and maxima % indmin - the position of the local minimum point in the sequence x % indmax - the position of the local maximum point in the sequence x X = x(:)-mean(x) % a vector N = length(x) % 'spline' - cubic spline interpolation % 'pchip' - cubic Hermitian interpolation % 'linear' - piecewise linear interpolation % 'nearest' - nearest neighbor interpolation % operator: selected morphological operator, see sub-function 'MF_operator' % % Output: % y: morphological filtered signal

textra

% % Input: % x: signal to be analyzed (a vector) % interp_method: selected interpllation method, such as 'spline', 'pchip', % 'linear' and 'nearest', in which 'spline' is recommended.







Textra