Discret low-pass-filter for velocity data

1 visualización (últimos 30 días)
Dom
Dom el 13 de Abr. de 2022
Respondida: Star Strider el 13 de Abr. de 2022
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.

Respuesta aceptada

Star Strider
Star Strider el 13 de Abr. de 2022
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).
.

Más respuestas (0)

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by