[Math] Numerical (Second) Derivative of Time Series Data

calculusderivativesdiscrete mathematicsoperator-theory

First and second order derivatives are often used in chromatography to detect hidden peaks. The time series data consists of Instrumental Response vs. Time at very short time intervals (250 Hz). I wanted to calculate the second derivative of the data numerically in Excel. The simple option is that we calculate the first derivative and then calculate the first derivative of the first derivative to get the second derivative.
The other option is to use the direct approach using central difference formula for the second derivative. The question is about the denominator of the second derivative from the central difference formula. It should the square of the time interval. This is my understanding and it is consistent dimensionally for example distance x (m) becomes acceleration (m/s2) as the second derivative of x.

A reviewer wrote a rather denigrating comment saying that there is a lack of understanding of the second derivative "definition" where the authors assert that the definition of a second derivative requires division by the square of the time interval. This reference to the square of a time interval suggests a worrying lack of understanding of the nature of the derivative 𝒅𝟐/𝒅𝒕𝟐 as an operator and not as an algebraic variable.
Do mathematicians agree with the above comment? Can we interpret d^2/dt^2 as if it is repeating the d operator twice divided by time interval squared? Thanks.

Best Answer

For a series of discrete values $x_1$, $x_2$, .. $x_n$ at regular intervals of time $h$, the central derivate at $x_i$ is

$$ \dot{x}_i = \frac{ x_{i+1} - x_{i-1} }{2 h} $$

This is preferable because $\frac{x_{i+1}-x_i}{h}$ is the average slope of the following interval and not exactly at the point $i$.

To get the second derivative apply the above to the first derivative

$$ \begin{aligned} \ddot{x}_i & = \frac{ \dot{x}_{i+1} - \dot{x}_{i-1} }{2 h} \\ & = \frac{\frac{ x_{i+2} - x_{i} }{2 h} - \frac{ x_{i} - x_{i-2} }{2 h} }{2 h} \\ & = \frac{x_{i+2}+x_{i-2}-2x_i}{4 \,h^2} \end{aligned}$$

The above definition is related to the Verlet Integration, also known as the leap-frog method since the derivative at $i$ does not contain the value $x_i$.