Best way to take derivatives of unevenly spaced data (with interpolations? discrete derivatives?)

I think your best bet would be to use ApproxFun. Once you have your data as a “Fun”, it is straightforward to take derivatives and integrate. Unfortunately, you need your data to be on a Chebshev grid for ApproxFun. If you are on an even grid, or and uneven one, a rational approximation can help. I wrote a small package (https://github.com/macd/BaryRational.jl) which was recently registered. The readme has an example on how to use the AAA algorithm to get such data into ApproxFun as a Fun.

1 Like