Averaging oscillating data points

40 visualizaciones (últimos 30 días)
Mika Nicholas
Mika Nicholas el 26 de Sept. de 2020
Comentada: Ameer Hamza el 27 de Sept. de 2020
I have some multiple sets of temperature readings of some air heated by a pulsing heater, so the data is not strictly sinusoidal. I want to average these pulses to create a smooth curve, the main issue is that the oscillations in the data have varying frequency and amplitude, how can I do this?
I have been trying the movmean function which has done a reasonable job at creating an average of the points however some oscillations, albeit much smaller, still manifest. I believe this is due to the varying frequency, I might be able to try to create a smoother curve by trying different span values, however, I don't believe it will ever create an oscillation free curve due to the function never being in phase for the whole data set. I've looked into the smooth function but not really worked it out and I think I may get the same issue. Manually trying different parameters for each data set will be time consuming so I am hoping there is another way but if there isn't, I guess I don't have a choice. I could also do an iterative process maybe to generate a smooth curve but due to the varying frequency, I don't know if, I would know how to do that.
I have attached some of my data I'm am trying to do this for.
Note: The first rise in the data is not an oscillation I am trying to dampen, the oscillations I want to damp/smooth are relatively small to the range, on the scale of <0.5 peak to peak amplitude.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 26 de Sept. de 2020
Editada: Ameer Hamza el 26 de Sept. de 2020
Try lowpass filter if you have signal processing toolbox
data = readmatrix('SampleTempData.xlsx');
t = data(:,1);
x = data(:,2);
dT = t(2) - t(1);
Fs = 1/dT;
y = lowpass(x, 0.001, Fs, 'ImpulseResponse', 'iir');
plot(t, x)
hold on
plot(t, y)
legend({'actual', 'filtered'}, 'FontSize', 16, 'Location', 'best')
  2 comentarios
Mika Nicholas
Mika Nicholas el 27 de Sept. de 2020
Sort of worked. Havent used lowpass before, I've been trying to get it to behave more like a damped step unit response for my other data but can't work it out. Maybe movmean is my the simplest option for the other data.
Ameer Hamza
Ameer Hamza el 27 de Sept. de 2020
If this was a damped step response, then seem to be to much noise and bias in the sensor values. I don't think frequency domain filtering techniques, such as movmean and lowpass is the correct way to do this. You may look for a model-based filtering method, such as Kalman filter, to get the filtered output.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by