Discret low-pass-filter for velocity data

3 次查看(过去 30 天)
I got a data set of velocity over time. I am trying to calculate the first and second derivative, but the data set is really noisy. How can I filter the data, so that the derivative yields realistic results.

采纳的回答

Star Strider
Star Strider 2022-4-13
That the data are ‘really noisy’ unfortunately says nothing about the nature of the noise. If the noise is band-limited (determine this by doing a Fourier transform on it), the noise can likely be eliminated with a frequency-selective filter. For broadband noise (and your signal since the nature of the noise is not described), I would use the sgolayfilt (Savitzky-Golay filter) function. I usually use an order 3 polynomial, and then experiment with the window length until I get the result that I want.
Take the derivatives of the filtered signal.
Use the gradient function to calculate the derivatives:
dydx = gradient(y) ./ gradient(x);
d2ydx2 = gradient(dydx) ./ gradient(x);
This does not require that the signals be sampled consistently, however for all other signal processing (including the fft function), they must be. Use the resample function to resample them to consistent sampling intervals if they are not. To determine sampling frequency consistency, calculate:
tsstd = std(diff(x))
where ‘x’ is the independnet variable. For a consistently-sampled signal, this should be near zero (on the order of 1E-15 or so).
.

更多回答(0 个)

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by