Interpolation method for data that is wave-like or oscillatory

I am attempting to Interp1 for interpolation of data that is wave-like or oscillatory in nature. I am planning on using the 'linear' method, but was wondering if anyone had any suggestions that might be better method in this function for data that is wave-like or oscillatory?

 Accepted Answer

It depends on how ‘wave-like’ it is. A 'linear' interpolation will work in most instances if the sampling interval is small enough. Otherwise, the 'spline' or 'pchip' methods would be appropriate. (Consider adding the 'extrap' argument as well if extrapolation could be an issue. It prevents NaN values from appearing in the extrapolated points.)

9 Comments

Ok, thanks. My sampling interval is a 1000 data points per second, so I think that should be enough for 'linear' interpolation. Do you agree?
My pleasure.
That depends on the approximate frequency of your signal. The lower the frequency, the more appropriate a linear approximation will be. For instance, a frequency of 100 Hz would have 10 data points per cycle, and a linear interpolation might not be adequate, depending on the accuracy you want. For a frequency of 10 Hz, the resolution is 100 samples per cycle, and a linear interpolation would be essentially indistinguishable from a nonlinear interpolation method. The highest uniquely resolvable frequency (the Nyquist frequency) in your data would be 500 Hz or 2 samples per cycle, but interpolating it would be pure guesswork.
So interpolating it might not be the best idea?
I also only analyze it from frequencies below 70 so I am not sure if this is a low enough frequency for interpolating.
Interpolating it is a good idea if you keep the necessary tradeoffs in mind. A frequency of 70 has about 14 samples per cycle (sampled about every 25 degrees or about every 0.44 radians), so a nonlinear method such as 'pchip' or 'cubic' might be best for all of them.
That is how I would interpolate your signal.
Also, consider using the Signal Processing Toolbox reample function instead of interpolating. The resample function incorporates a FIR anti-aliasing filter that is an important consideration in signal processing. It only accepts integer values for its resample ratio arguments, so use the rats function to calculate them.
Would this resample function mess with the phase angles of the wave signal? I do not think it would, but it is very important for my data analysis that there is no phase delay in the wave form data.
I doubt that it would change the phase significantly (other than to increase the resolution), but I never actually did that experiment. That would certainly be an argument in favor of using the resample function rather than doing a simple interpolation.
To do that experiment, I would do the Fourier transform of the original and resampled signals and then overplot the amplitudes and phases of both of them (using the subplot and hold functions) to compare them directly.
Ok, great. Thank you again for answering all these other questions I have.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!