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

pandas - add missing rows on the basis of column values to have linspace

I have a pandas dataframe like a b c 0 0.5 10 7 1 1.0 6 6 2 2.0 1 7 3 2.5 6 -5 4 3.5 9 7 and I would like to fill the missing columns with respect to the column 'a' on the basis of a certain step. In this case, given the…
user1403546
  • 1,680
  • 4
  • 22
  • 43
2
votes
0 answers

Bilinear interpolation for retrieving a pixel rectangle in OpenCV

This problem comes from function getRectSubPix_8u32f in OpenCV. Basically, the target is to interpolate following pixel's intensity(denote as I(a,b)): but what puzzled me was the code snippet: float a = center.x - ip.x; float b = center.y…
2
votes
0 answers

How to interpolate/resample unequally spaced timeseries data in java?

I have a lot of movement data from a sensor of an android phone. The sensor-data is not equally spaced. The first column is the timestamp, the second to fourth are the values. 1476998233373060.00 -13.724.029 -0.32222483 0.6645355 1476998243378590.00…
2
votes
1 answer

Confusion about d3.interpolateObject

I was just investigating the D3 Interpolate Object function, and I noticed some strange behavior. However, I'm not very familiar with D3, so it could be that I'm simply misunderstanding something. Given the following data and interpolation…
2
votes
0 answers

Diffing algorithm: Obtaining timestamps of spoken syllables given actual transcript

I have an audio file that is a recording of a person speaking different letters in sequence, along with a correct, human created transcript of this audio file, e.g. a string ABCDEF. This audio file is then passed into a speech-to-text transcription…
2
votes
0 answers

Phaser 3 - Sprite linear interpolation using movement queue

I'm currently using Phaser 3 to represent my server's state. Every x amount of time, I am sent the server's game state, this is what the client looks like: var t1 = Date.now(); var serverUpdateDelta = 0; Client.socket.on('usersPool', usersPool => { …
skpdm
  • 1,378
  • 2
  • 15
  • 31
2
votes
2 answers

Swift Linear Interpolation and UpSampling

I have a stream of metrics that are unevenly sampled. I want to linearly interpolate and upsample these metrics to a specific sampling frequency. I have tried to use the Accelerate Framework and the SIMD framework but I am not really sure what to…
2
votes
2 answers

unity3d calculate level of interpolation using two vectors and a point somewhere inbetween

I have three vector3 variables; the start, the end and some point in-between. I know in normal linear interpolation you give the start and end points along with a 't' variable such as "0.6" which returns the position at that point along the…
user414025
  • 105
  • 1
  • 10
2
votes
2 answers

Having trouble conceptualising how to implement a linear interpolation in R

I am fairly new to coding and am having trouble even conceptualising how I will implement this problem in R. Sorry if I am missing something totally obvious. I am trying to find the pressure correction factor (y) for each minute at a particular…
ZoeR
  • 23
  • 4
2
votes
1 answer

Why is my interpolation not working properly in my function?

I have a fairly long code that processes spectra, and along the way I need an interpolation of some points. I used to have all this code written line-by-line without any functions, and it all worked properly, but now I'm converting it to two large…
2
votes
4 answers

SQL query to interpolate timestamp basing on adjacent records

I use Oracle and have the following table: create table test as select to_date('02.05.2017 00:00', 'DD.MM.YYYY HH24:MI') as DT, 203.4 as VAL from dual union all select to_date('02.05.2017 01:00', 'DD.MM.YYYY HH24:MI') as DT, 206.7 as VAL from dual…
Ievgen
  • 45
  • 5
2
votes
1 answer

Linear interpolation by group in R

Suppose the following data: Date V1 V2 1 1996-01-04 0.04383562 days 0.1203920 2 1996-01-04 0.12054795 days 0.1094760 .............. 3 1996-02-01 0.04383562 days 0.1081815 4 1996-02-01 0.12054795 days…
Hercules Apergis
  • 423
  • 6
  • 20
2
votes
2 answers

Interpolating an Array in Scala

I'm trying to linearly interpolate an Array[Option[Long]]. For example given: val example1 = Array(Some(20l), None, Some(60l)) val example2 = Array(Some(20l), None, None, Some(80l)) val example3 = Array(Some(20l), None, None, Some(80l), Some(90l),…
Amir Ziai
  • 148
  • 1
  • 6
2
votes
1 answer

How to resample a Numpy array of arbitrary dimensions?

There is scipy.misc.imresize for resampling the first two dimensions of 3D arrays. It also supports bilinear interpolation. However, there does not seem to be an existing function for resizing all dimensions of arrays with any number of dimensions.…
danijar
  • 32,406
  • 45
  • 166
  • 297
2
votes
1 answer

R: Why isn't this matrix 3d linear interpolation working correctly?

I have a matrix of values and zeros, where zero= NA. The values are interspersed around the matrix, and what I want to do is interpolate the values of all the NA values. This is the data: I'm trying to guess all of these values by taking all the…
Amit Kohli
  • 2,860
  • 2
  • 24
  • 44