Filling data gaps in a periodic timeseries in MATLAB

11 次查看(过去 30 天)
I am looking for a method to fill in data gaps in a time-series that contains periodic data (in this case with a frequency equal to a tidal frequency, so both semi-diurnal and spring/neap frequencies) using MATLAB. The data series also contains noise which I would like to superimpose on top of the artificial data that fills the time gap. The data has a certain trend that I want to preserve. Ideally I would be looking at a method that uses the recorded data on either side of the time gap. The data files are too large to post here. However the sampling rate is 5 mins and there is approximately a week worth of data missing.
<<
>>
Is there anyway of doing this in Matlab?
Thank you.
Donald John
  2 个评论
Yona
Yona 2014-10-23
编辑:Yona 2014-10-23
how this gap is in the data? It is a NaN value in voltage or every time that 2 consecutive data have difference of more that X time, it a gap or something else?
when this gap will define, you just need to find it and plot separated data set.
To help you remove noise, we need your definition of noise. if you just what to smooth your data, take a look on figure "tools"-> "basic fitting"
Donald John
Donald John 2014-10-23
Thank you for your response. The gap is represented by NaN values in the voltage. Can you explain what you mean when you say, 'you just need to find it and plot separated data set', how would I go about doing this?

请先登录,再进行评论。

回答(2 个)

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014-10-24
编辑:Bruno Pop-Stefanov 2014-10-24
This is definitely not an easy problem. There are several ways you can go about this.
1) Curve Fitting
The easiest method would be to try to fit a curve to the data you have. Curve Fitting Toolbox has an app that allows you to quickly try different models, adjust parameters, and immediately see whether you found a good fit or not. The downside of this method would be that it only estimates the parameters of a curve. It won't estimate the noise. You'll get a smooth curve for the week of missing points, instead of noisy measurements.
Read more here:
There are also numerous other examples listed here:
2) Time Series Regression
A better approach would be to estimate your time series as an auto-regressive model (AR, MA, ARMA, ARMAX, GARCH, or others). Econometrics Toolbox provides tools for estimation, simulation and forecasting of time series.
Take a look at the examples on this page and see if you could adapt something your problem:
I am not sure whether you can use the left and right ends of your data to estimate a model at once, or if you can only use once at a time.

Donald John
Donald John 2014-10-30
Thanks for your response. I am going to give both of these methods a try. I'll report back here once I have had a chance to do so. In the meantime any further input is much appreciated!! Thanks again.

Community Treasure Hunt

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

Start Hunting!

Translated by