interpolation

How can I detect "missing" elements in an IEnumerable<T>?

I've got an IEnumerable<T> containing a list of data elements with consistent intervals in one of the properties: List<Interval> list = new List<Interval> { new Interval{ TIME_KEY = 600}, new Interval{ TIME_KEY = 605}, new Interval{ TIME_KEY = 615}, new Interva...

Wanted: C# programming library for mathematics.

What I need is: plots creation, stuff for interpolation, stuff for counting such things as and where L(x) is an interpolation built from some data (points) generated from original known function f(x). meaning we know original function. we have a range (-a, a) - known. We need library to help us calculate data points in range. we ...

Using graphics hardware for audio processing in iphone app

We are developing an iphone app that needs to process audio data in real time, but we are suffering with performance. The bottlenecks are in audio effects, which are in fact quite simple, but the performance hit is noticeable when several are added. Most of the audio effects code is written in C. We think there are two places we can us...

In Mathematica, what interpolation function is ListPlot using?

Hi, [Screenshot below] I was using ListPlot to draw a smooth line through some data points. But I want to be able to work with the 1st and 2nd derivative of the plot, so I thought I'd create an actual "function" using Interpolation. But as you can see in the picture, it's not smooth. There are some strange spikes when I do Plot[Interp...

Implementing semi-implicit backward Euler in a 1-DOF mass-spring system

I have a simple (mass)-spring system wih two points which are connected with a spring. One point is fixed at a ceiling, so I want to calculate the position of the second point using a numerical method. So, basically I get the position of the second point and it's velocity, and want to know how these two value update after one timestep. ...

Issues with 2D-Interpolation in Scipy

Hi! In my application, the data data is sampled on a distorted grid, and I would like to resample it to a nondistorted grid. In order to test this, I wrote this program with examplary distortions and a simple function as data: from __future__ import division import numpy as np import scipy.interpolate as intp import pylab as plt # De...

bicubic interpolation algorithm using Blake L. Carlson's code

Could someone please explain to me how this code manages to interpolate images... // bicubic interpolation by Blake L. Carlson <blake-carlson(at)uiowa(dot)edu float f_x, f_y, a, b, rr, gg, bb, r1, r2; int i_x, i_y, xx, yy; for(long y=0; y<newy; y++){ //info.nProgress = (long)(100*y/newy); //if (info.nEscape) break; f_y =...

Image Resampling Bicubic Interpolation Java

i have resized image but its quality is low. i heard of bicubic interpolation but i cant get any implementation code!! can sombody provide me that code please!! ...

Lagrange interpolation in Python

I want to interpolate a polynomial with the Lagrange method, but this code doesn't work: def interpolate(x_values, y_values): def _basis(j): p = [(x - x_values[m])/(x_values[j] - x_values[m]) for m in xrange(k + 1) if m != j] return reduce(operator.mul, p) assert len(x_values) != 0 and (len(x_values) == len(y_va...

Optimizing interpolation in Mathematica.

As part of my work, I often have to visualize complex 3 dimensional densities. One program suite that I work with outputs the radial component of the densities as a set of 781 points on a logarithmic grid, ri = (Rmax/Rstep)^((i-1)/(pts-1), times a spherical harmonic. For low symmetry systems, the number of spherical harmonics can be fa...

RAILS: paperclip and creation date based directory structure

Hi there, does anyone know how I can configure my rails model, which is using paperclip for data storage, to use creation date based directories like for example in fleximage ?? At present I'm using: has_attached_file :bookblock, :path => "#{CONF['storage_path']}bookblock/:id_partition/:style.:content_type_ehas_attached_filextension" ...

Fastest way to fit a parabola to set of points?

Hi, Given a set of points, what's the fastest way to fit a parabola to them? Is it doing the least squares calculation or is there an iterative way? Thanks Edit: I think gradient descent is the way to go. The least squares calculation would have been a little bit more taxing (having to do qr decomposition or something to keep things ...

How to escape a % sign in a configobj value?

I'd like to use both parse time and runtime interpolation for values of a configobj configuration file. The easiest way to do simple string interpolation in Python is "%(foo)s" % somedict. Unfortunately configobj uses the same interpolation mechanism and I have not yet found a way to escape it. Ideally my value would look like: othervar...