Numerical integration of functions sampled with constant and non-constant rates I have arbitrary functions of time $y(t)$ (sin, linear, sawtooth, triangular, etc) with two types of data sampling, namely constant sampling rate and variable sampling rate (in some parts the function has a denser collection of values than in other parts).   
I would like to know:


*

*Is there a numerical method to integrate a function with constant sampling rate. Is there a numerical method to integrate a function with variable sampling rate with the best accuracy ? 

*If I integrate both functions with constant and variable sampling rate, will I get about the same results? 
Below I'm showing an example of the same function $y(t)$ with constant and variable sampling rates.


 A: *

*There are several approaches for evaluating integrals of uniformly sampled functions, the simplest ones being Newton-Cotes quadrature formulas. You can easily find numerical integration approaches in books on numerical methods, see for example N.S. Bakhvalov, Numerical Methods, Mir Publishers Moscrow, 1981. Although sophisticated integration rules consist of optimizing the quadrature nodes, I do not think this is your case, as you do not mention any particular rule for choosing quadrature nodes. In this case ("random" sampling), I would suggest using some form of interpolation to "resample" the non-uniformly sampled function $y(t)$ to a regular grid and then applying quadrature approaches for uniformly sampled functions (constant rate).

*If you decide to apply the interpolation+quadrature scheme, then, for a fixed applied numerical integration technique, I would expect to achieve better accuracy for functions having constant sampling rate, because in this case you will not experience interpolation errors. 

