I'm seaching for a solution how to interpolate with missing data (NaN). I tried the function "naninterp.m" but I doens't work good because of the complexity (non-stationarity) of my data.
My original data (with missind values) looks like this:
http://freenet-homepage.de/physicnews/datafiles/MissingValues11ce1b7338f.png
The red line in the figure represents the interpolated values calculated with "naninterp.m".
Does anybody knew a solution how to improve the interpolation?
Thanks!
Use of a code like naninterp, or for that
matter my own inpaint_nans, MUST fail on
this data. At least, it will fail to give you
an interpolant that comes anything near
to the values inside that hole. These tools
try to provide a SMOOTH interpolant
across that hole.
You are looking for something that will
not only interpolate across that large hole
in your data, but will also match the
"texture" of your function inside the hole.
For this you will probably need to use
some sort of time series or Fourier series
approach.
John
thank your for your reply.
Yes, the problem relies on my data - not the (well programmed) functions "naninterp" and "inpaint_nans" ;)
I'm looking for a function to reconstruct the "fine structure" of my data. Your hint about a Fourier series approach is good. I will try it. Thanks!
Filling such gaps can be achieved using prediction filters, as is
described for example here:
http://lib.tkk.fi/Diss/2004/isbn9512269503/article3.pdf
There is a free Matlab Toolbox called WarpTB from Aki Harma for
computing warped prediction coefficients and for warped filtering.
Also, one of the authors of the above paper (Paulo) has been very
forthcoming and helpful when contacted directly.
Regards,
Andor
thank your very much for your excellent tip about the "prediction filters" and "WarpTB"! It's exactly that what I need to solve the probem.
Regards,
Felix