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.
-1
votes
0answers
21 views
Linear interpolation of lines yields different graph in R
I Have created the following dataframe and plotted the same using ggplot
library(data.table)
require(wrapr)
library(readxl)
library(dplyr)
library(tidyr)
library(ggplot2)
library(plotly)
####...
0
votes
0answers
36 views
Curved lines appearing after log transform in ggplot when values are interpolated in R
I have created the following dataframe
library(data.table)
require(wrapr)
library(readxl)
library(dplyr)
library(tidyr)
library(ggplot2)
library(plotly)
df <- data.frame("X_Frequency" = c(5, 10, ...
0
votes
0answers
11 views
How do I use scipy.interpolate.LinearNDInterpolator or some other method to to interpolate over scattered data?
My data consists of
x (48 points)
y (50 points)
z (80 points)
f1 = (48 X 50 X 80) points
=(192000 points)
f2 = (48 X 50 X 80) points
=(192000 points)
in the interpolated data space, z is ...
1
vote
2answers
41 views
How to fix jitter caused by position interpolation
I want to interpolate the position of an object over a duration of time, I'm using pygame.
When the game wants to move the object to a position it calls interpolate_position with the position it ...
0
votes
1answer
25 views
Linear 1D interpolation on multiple datasets using loops
I'm interested in performing Linear interpolation using the scipy.interpolate library. The dataset looks somewhat like this:
DATAFRAME for interpolation between X, Y for different RUNs
I'd like to ...
1
vote
1answer
24 views
Sorting Range in VBA function without affecting data in worksheet
I am creating a linear interpolation function in VBA. Here is what it looks like:
Function INTERP(X0 As Variant, ByVal X As Range, ByVal Y As Range) As Variant
Dim i As Long
Dim N As Long
...
0
votes
1answer
60 views
Writing a linear interpolation function in MATLAB
I'm trying to write a linear interpolation script in matlab. How do I fix that the vectors are of different length?
I've tried to wrap my head around this issue, but can't seem to get it. Should an ...
0
votes
0answers
37 views
Resampling data with gnuplot
In some cases you might need to resample your data. How can this be done platform-independently with gnuplot? Below is one attempt.
The dataset $Dummy contains the interpolated values, however, with ...
0
votes
0answers
29 views
MySQL: Interpolate monthly values from daily recordings
I would like to calculate monthly meter values from irregular readings. My data looks like this:
| Date | Meter Reading |
--------------------------------
| 2018-01-01 | 1.200 |
| ...
0
votes
1answer
30 views
linear spine interpolation of time-series by groups
I am dealing with a time series of balance sheet of thousands of listed companies from 1990-2018. In some years I only have annual balance sheet while in other years I have 5 balance sheets, including ...
1
vote
2answers
72 views
Find missing values by linear interpolation (time serie)
I have these data.frame called df1 which represents each month over three years (36 rows x 4 columns) :
Year Month v1 v2 v3
1 2015 1 15072.73 2524.102 17596.83
2 2015 ...
2
votes
0answers
52 views
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:
...
0
votes
1answer
43 views
Linear interpolation R
I have this data.frame (12x2)called df_1 which represents monthly values :
month df_test
[1,] 1 -1.4408567
[2,] 2 -1.0007642
[3,] 3 2.1454113
[4,] 4 1.6935537
[5,] 5 0....
1
vote
0answers
99 views
how to linearly interpolate in excel based on empty cells
The first macro runs a predefined check in order to find gaps in the data set y and z: we have data x which is the order running from 1-7. The values y and z are the values with gaps which are subject ...
0
votes
0answers
14 views
tck interpolate.bisplrep python, what does it do?
I am re-posting this question as I hope someone can help me
Would someone please explain what does tck interpolate.bisplrep do? I was trying to understand scipy explanation but they did not give ...
0
votes
0answers
56 views
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....
1
vote
1answer
26 views
Linear 1D interpolation using a interp1D function in Python on panda dataframe columns
I'm trying to use the "interp1d " function from scipy.interpolate to generate an interpolation from two columns in a python dataframe . I'm using python 2.7. I'm able to generate the interpolation ...
0
votes
1answer
130 views
Fastest Method to compute Linear interpolation between 2 points in QT using OpenGL
I'm trying to interpolate a triangle with the help of vertex coordinates.
a
|\
| \
| \
| \
b|_ _ _ \c
I'm interpolating the vertices in this order (b,a),(a,c)and (c,b).
Here the a,b and c ...
2
votes
1answer
48 views
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. ...
1
vote
0answers
21 views
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 ...
0
votes
0answers
37 views
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
votes
2answers
108 views
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 ...
0
votes
0answers
76 views
Aggregate and interpolate overlapping time-series data
I'm trying to aggregate counter data from two different types of measurements.
The first type of measure gives an exact value of the counter on a given day.
| Id | Day | Value |
|----|-----|-------|
|...
0
votes
0answers
37 views
Pandas linear interpolation always replace with the same value
I am performing a linear interpolation with a Pandas Series but it seems that it keeps replacing the NaN with the same value and I can't figure out why..
# To check where are located the missing ...
1
vote
1answer
51 views
Constant sample based background subtraction and interpolation
I need your expertise for a problem. I have the following matrix with different columns.
Time subsamp raw filt_BG filter
230.5382060 1 1 1 0
230.5382176 2 ...
1
vote
1answer
95 views
linear interpolation (approx) by group in a dplyr pipe in R
I have a question that I find kind of hard to explain with a MRE and in an easy
way to answer, mostly because I don't fully understand where the problem lies
myself. So that's my sorry for being vague ...
0
votes
0answers
32 views
Python: Data Interpolation: working with interpolated functions
I have several (denoted by index i) sets of datapoints (x,y) stored in vectors x_i and y_i.
x_i is not necessarily of the same lenght as x_i+1.
I want to interpolate the data for every i ...
2
votes
2answers
39 views
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 ...
2
votes
2answers
58 views
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 ...
3
votes
1answer
35 views
Linear interpolate where data is invalid
I would like to linearly interpolate a single column based on previous and next know values only where data is equal to "---".
Data example:
0
---
---
---
10
---
20
22
15
---
---
---
-15
Wanted ...
0
votes
0answers
76 views
Android circle reveal animation not smooth
am creating login and signup in same page with circle reveal animation ,switch the view using a floating action button, it very lag when switching one view to another view,
Login page Contain two ...
0
votes
0answers
209 views
C# Efficiently Linearly Interpolating through n numbers with a sample rate x
I have a jagged float array chunks (float[][] chunks), and I want to interpolate each chunk of floats (with length n) with a sample rate of x. For example, if chunks[0] was {1f, 5f, 10f} so n = 3 and ...
-2
votes
1answer
31 views
The polynomial interpolation of degree 4
For the provided data set, write equations for calculating the polynomial interpolation of degree 4 and find the formula for f by hand.
x = [1, 2, 3, 4, 5]
y = f(x) = [5, 31, 121, 341, 781]
0
votes
0answers
148 views
Scipy interp2d for large data file
Edit from the beginning:
I want to interpolate txt data file (has three columns x, y and z this time) using interp2d. The shape of the file is (1756612, 3) and the data is like, x,y,z=
[[ 0.1569 ...
0
votes
1answer
344 views
How to plot interpolate station data over a map (basemap)?
I've got a file with accumulated rainfall over a month in 5 stations. There are lat, lon and rain data in csv file. My file is just like that:
Out[18]:
lat lon rain
0 -48.379000 -1....
0
votes
2answers
218 views
finding the interpolated intersection between two arrays in Python/Numpy/Scipy
I am looking for a simple approach to finding the interpolated intersection between two Numpy arrays. I know that this is simply achieved if we have two function handles, rather than two arrays, as ...
2
votes
1answer
59 views
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 ...
0
votes
1answer
81 views
Lagrange Interpolation Algorithm in C Diverges After Many Steps
I have a Lagrange interpolation algorithm that begins to diverge after many time steps and I can't seem to figure out why. As a quick review, if I had two arrays
int x[11] = {0, 10, 20, 30, 40, 50, ...
1
vote
0answers
65 views
Convert from pressure data to a sound
I'm using a pressure sensor to "record" a sound coming from a stethoscope. As a result i have a file containing the pressure values. Plotting the results with this simple python code
import ...
0
votes
1answer
35 views
How can i set a variable to 0 gradually in p5.js (javascript)?
I'm trying to control an ellipse with the up,down,left,right keys.
I want to make it smooth, so the ellipse doesn't stop immediately.
Also when its moving to the left and you press the right arrow, it ...
0
votes
1answer
231 views
Expanding a 2D Matrix in Matlab with Interpolation
Let's say I have a 4 pixel by 4 pixel image with values between 0 and 255 and I want to expand it to an 8-by-8 image, interpolating where necessary. I know how to interpolate a vector this way with ...
1
vote
1answer
376 views
Numpy percentiles with linear interpolation - wrong value?
The linear interpolation formula for percentiles is:
linear: i + (j - i) * fraction, where fraction is the fractional part of the index surrounded by i and j.
Suppose I have this list with 16 ...
0
votes
1answer
273 views
resamplig pandas (not as a timeseries)
I have a pandas dataframe like this:
index x y
0.010 1 Nan
0.011 Nan 3
0.014 NaN 4
0.019 9 Nan
0.020 10 7
This matrix comes from a concatenation of 2 ...
0
votes
1answer
303 views
Digital image processing bilinear interpolation
If in digital image processing, i use bilinear interpolation for image scaling and if the scaling factor is 1.5x then how do i represent 1.5th column in a physical matrix structure?
1
vote
0answers
141 views
gdal_grid linear producing odd results
I Have a large Point shapefile (xyz, about 65,000 points) from a LiDAR las file and am trying to interpolate this onto a grid using gdal_grid:
gdal_grid -ot Float64
-txe 422306.5970 ...
0
votes
1answer
270 views
linear interpolation in time series in R
I have a data set with body temperatures taken every minute for 8 hours. I removed aberrant data and now have NA values, sometimes just one alone, and sometimes more then 10 in a row.
I would like to ...
0
votes
1answer
62 views
Better way of generating linear spline based on vertexes
I'm trying to calculate y values based on x values and a series of curves defined by a set of vertices. I'm pretty new to R, and couldn't find a direct way to do this. I've found a couple of methods,...
0
votes
1answer
171 views
Most efficient linear interpolation using integer fraction
I’m playing around with Direct digital synthesis wavetables on an Atmega328.
Given an 8-bit fractional value F, and two 8-bit values A, B, what would be the most efficient way to calculate the linear ...
-6
votes
1answer
86 views
2D interpolation of arrays in C [closed]
I have a data file where I have computed luminosity of stars as function of energy and mass. So for a given mass I have energy ranges from 0.1-10 keV and then I have mass ranges from 10-100. Now I ...
0
votes
1answer
973 views
Filling Missing Values in a Time Series with Next and Prev Values
I am trying to fill in the missing values of a time series like the one below. I am using Python3.
Week Rainfall(cm)
1 1
2 NaN
3 9
4 10
5 11
6 NaN
7 NaN
8 14
I do not want ...