Questions tagged [linear-interpolation]

Linear interpolation is the process of approximating intermediate values given an assumption that the ranges of missing data look roughly like straight lines.

Linear interpolation is largely used for its simplicity and is typically more effective given a greater density of data. The more complex the underlying relationship of the quantities involved, the less likely linear interpolation is to provide a good value estimates.

In scientific software for statistical computing and graphics, function approx performs 1D linear interpolation.

437 questions
2
votes
2 answers

Android: Need to apply linear time interpolation on accelerometer data

The raw data retrieved from the Accelerometer sensor (samsung galaxy S) needs to be processed in order to create robust templates for each subject so i need to apply linear time interpolation because Due to the android SDK, the phone only outputs…
2
votes
1 answer

Linear interpolation with GL_FLOAT and GL_LUMINANCE?

I'm developing an app using OpenGL ES 2.0 on an iPad 3. I'm attempting to switch from GL_UNSIGNED_BYTE when calling glTexImage2D() to GL_FLOAT for "type", with GL_LUMINANCE as the "internalFormat" and "format" parameters. (formerly GL_RGBA) The…
Vern Jensen
  • 3,449
  • 6
  • 42
  • 59
2
votes
2 answers

Matlab, Straight Line between 2 points with n points between

I want to make a function that will take 2 data points: (x1, y1) and (x2, y2). Then I want to return a function f, which is the straight line between the points with N points in between. If I take in the x and y coordinates of the 2 data points then…
user1011182
  • 43
  • 1
  • 7
2
votes
1 answer

How does linear interpolation work in classic Perlin noise?

Yesterday I ported the classic Perlin noise (src: http://mrl.nyu.edu/~perlin/doc/oscar.html#noise) to JavaScript. Strangely the generated noise looks a lot different from what I've expected. The classic Perlin noise uses linear interpolation/lerp,…
Pipo
  • 5,623
  • 7
  • 36
  • 46
1
vote
1 answer

Calculating internal color values between known color points (bilinear interpolation?)

This seems like a pretty elementary math/graphics question, but for some reason I can't seem to wrap my head around it. What I've got is four line segments, outlining a quad. Each vertex on each line segment has a known color value. For…
J23
  • 3,061
  • 6
  • 41
  • 52
1
vote
1 answer

GODOT Interpolation: Interpolation is not behaving how I expect visually

I am programming in the Godot game engine, and I have recently been working with interpolation to smooth out the turning (rotation) of one of my mob instances. I am new to interpolation in general, so I have done a deep dive into it, and using it in…
1
vote
1 answer

Can Pandas Linear interpolation capture seasonality patterns?

I have a time series dataset that contains 29,184 hours of data. There are around 1k+ rows of missing values. Here is the link to the dataset: dropbox Here is a small preview of the dataset: NUMBER_OF_VEHICLES DATE_TIME …
1
vote
3 answers

Smooth linear interpolation using NumPy

I need to recode an equivalent of the NumPy interp function. In order to do that, I thought of building a pairwise distance matrix, and then using this matrix to define "weights" that I use to multiply the target values. def interp_diff(x, xp, fp): …
carlitador
  • 47
  • 9
1
vote
2 answers

RegularGridInterpolator excruciatingly slow compared to interp2d

Consider the following code example: # %% import numpy from scipy.interpolate import interp2d, RegularGridInterpolator x = numpy.arange(9000) y = numpy.arange(9000) z = numpy.random.randint(-1000, high=1000, size=(9000, 9000)) f = interp2d(x, y, z,…
1
vote
0 answers

Non-conformable arrays error in Regression Kriging in R

Grretings to all! In the Regression Kriging, i want to create a map for Standard Deviation of the Ordinary and the Regression Kriging. The pH.sd (from the OK, Ordinary Kriging) are in a matrix: double [250292] The pH.regkrig.sd (from the RK,…
1
vote
1 answer

How can I output values for time intervals with no data in QuestDB

I am using QuestDB to get the amount of events we are receiving every 500 milliseconds. Everything works as expected and I can use SAMPLE BY 500T to aggregate in half a second intervals. However, for the intervals where we don't have any data, we…
Javier Ramirez
  • 3,446
  • 24
  • 31
1
vote
1 answer

Linear interpolation in Python using interpolate.interp2d

I have recently started using Python and I have a problem that I would like to propose. I have three arrays (X1, X2, and X3). I need to apply linear interpolation. The goal is given new points with coordinates X1 and X2 apply interpolation in order…
1
vote
0 answers

How to calculate unknown values in Sine linear interpolation using quadrature look up table (LUT)?

I have generated a sine wave using a 257-point look-up table that covers only one quadrant (4th quadrant). The entries in the table are in fixed point format (Q1.15) [o,.....,-32768]. linear interpolation is used for finding unknown values in the…
1
vote
1 answer

Linearly Interpolate Missing Data in mySQL

COVID-19 Data obtained from OurWorldInData includes total_boosters column to track vaccine boosters in any given country. My goal is to create a column for daily new boosters (boosters_new), then create a 90 day rolling sum (boosters_90roll). The…
1
vote
1 answer

Interpolation on irregular grids

Is it possible to perform 2D interpolation in Julia where one of the coordinates is irregular? Take the following example, where x is irregular, but y is regular: x = [0.5 2 3 4.; 0.6 1 3 4.; 0.7 2 3 5.; 0.8 2 3 4.;] y = [1; 2; …
TylerD
  • 361
  • 1
  • 9