How to find the position of a step that changes its properties as a function of position

I want to find the step position in my noisy data. After several attempts, I tried to use an edge detector or curl up with a matching filter to get the step position. A problem that is not exact, because the step changes its shape as a function of position.

For example, given that my data vector is 1000 elements, the step width will be 30 around the pixel 200 and 70 around the pixel 700, similar to how the wave packet expands due to dispersion. There are several properties that change somewhat, so the general question is, how can I find the position of the step? The corresponding filter is limited only to a certain shape and will give an inaccurate position. The edge detector is sensitive to bias and also gives an inaccurate position. What other approaches do you know? I would be happy to know new ideas.

The following is an example of steps that change positions without interference or other functions. enter image description here

And here are the same steps + noise and one additional function (offset for better visualization). enter image description here

+4
source share
1 answer

I would make a noise-insensitive kind of numerical differentiation and find its peaks (I don't have Matlab at hand, so it might have typos):

n = length(x); % x is the original data vector m = 30; % smallest step width you expect y = zeros(n - m, 1); % the "numerical derivative" of x for i = 1 + m : n y(i - m) = x(i) - x(i - m); end figure; plot(y) % now find the peaks of y using a sliding window and thresholding % sliding window width should be the largest step width you expect 

This simple approach has worked for me in the past.

Another method for calculating the numerical derivative is to calculate the slope in the middle of the (parabolic) filter

+2
source

Source: https://habr.com/ru/post/1491223/


All Articles