Numerical differentiation: Difference formulas for the first derivative
The central difference method via cross-correlation and applied to measurement data
Suppose is a finite discrete signal consisting of values of a continuous signal measured at equal intervals, say with sampling frequency . So the time step size is given by . In other words, with for and some natural number .
The central difference formula states that the derivative for is approximated by: Let be the filter defined by In a finite vectorial description we choose . When we extend the measurement data with zeros on the left- and right-hand side. if necessary, we can als write the formula for the approximation of the first derivative in the measurement points in terms of a cross correlation: When a programming language has built-in functions for these operations, we can use them to calculate first derivatives. If you don't want to extend measurement data with zeros, then you have to be happy with a derivative in fewer points than you measured because the edge points in the dataset cannot be handled in this case.