Interpolation method for data that is wave-like or oscillatory
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
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
Star Strider
on 21 Oct 2016
0 votes
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
Krispy Scripts
on 21 Oct 2016
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?
Star Strider
on 21 Oct 2016
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.
Krispy Scripts
on 24 Oct 2016
So interpolating it might not be the best idea?
Krispy Scripts
on 24 Oct 2016
I also only analyze it from frequencies below 70 so I am not sure if this is a low enough frequency for interpolating.
Star Strider
on 24 Oct 2016
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.
Krispy Scripts
on 24 Oct 2016
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.
Star Strider
on 24 Oct 2016
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.
Krispy Scripts
on 24 Oct 2016
Ok, great. Thank you again for answering all these other questions I have.
Star Strider
on 24 Oct 2016
As always, my pleasure.
More Answers (0)
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)