12/20/2023 0 Comments Arduino println interpolation![]() Remapping and drawing pixels (or segments) keeps all information, even transients. It is used by digital oscilloscopes firmwares and hardwares, but it is very complex, and creates funny glitches in certain circumstances. If the data represent a periodic function, and you have to resample and then interpolate, a commonly used algorithm is "sin(x)/x interpolation". If the samples count is not a multiple of the viewport width, or the viewport width is not far smaller than the samples count, it is more complex, and then interpolation is probably needed. If the samples count is a multiple of the viewport width, or the amount of data is much larger than the viewport x axis pixels count, it is easy : you drop points, but doing this you lose information, particularly transients. It is resampling if you reduce the number of points. I am pretty sure the answer to your problem is simple. What are yout data and how much ? Xmin, Xmax, Ymin, Ymax, N You also have to to decide a criteria for accuracy : mean square deviation for example. Splines (particular polynomial functions) are generally used as an approximation, and you have to calculate control points. (2 points -> degree 1, 3 points -> cubic, and so on). ![]() ![]() Using polynomial functions is not easy : for an accurate representation of n points, you have to calculate a n-1 degree polynom that has all the input points as solutions. ![]() You could have to convert floats into long integers (floating point into fixed point)īut it also depends on the source array size : it could be more efficient to first resample, and then remap. See Map() : this function does exactly what you need : conversion of one coordinate system into another. Remapping is used for windowing and viewporting on all computers since the first GUI. If you have less output points than input points, this has nothing to do with interpolation.Īs a starting point, you could simply try remapping. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |