curveutils

A set of self-contained C++ routines to sample and resolve functions properly for plotting, and more. In all cases, the documentation is contained entirely in the header files, and usage examples are provided in the tests/ directory. All code can be obtained from the SVN repository.

Features

Function sampling

Problem: Given a univariate function y = f(x), sample it in the interval [a, b], choose sample points x such that sharp features are fully resolved, using a parsimonious number of points.

Use: FunctionSampler1D.h or FunctionSampler1D_par.h (somewhat parallel friendly).

An example sampling of a highly oscillatory function:
example sampling plot
As can be seen, the places where the function has high curvature are sampled very finely.

Feature finding

Problem: Find the set of peaks (local maxima or minima) of a univariate function.

Use: PeakFinder1D.h. Processes the output of the sampling functions above, returning a list of all found features and some information on the properties of each peak/valley.

Spectral feature fitting

Problem: Fit a Lorentzian to a curve.

Use: SpectralFit.h/SpectralFit.cpp. Attempts to fit spectral lineshapes robustly. Can optionally use constrained least squares fitting to optimize the fitting parameters.

Contact

Please direct all comments/complaints to Victor Liu (email: victor [period] liu [at] gmail).