Hello Richard,
You will get the first and second derivative of the waveform, as you’d expect.
Some knowledge about Z-transforms tells us that this is tantamount to EQ-ing the signal so as to boost higher frequencies: linear in frequency for delta and quadratic in frequency for delta-delta.
The reason why we have delta and delta-delta in librosa is that np.diff makes no attempt at handling boundary effects. So if x has length T, np.diff(x) has length T-1, and np.diff(x, 2) has length T-2. This becomes a problem for feature engineering because one typically wants to stack features (e.g., MFCC) with its first and second derivative.
Meanwhile, with librosa, we guarantee that delta leaves the input length (T) unchanged. We do so by relying on a numerically stable implemention of n-th order differentiation, known as Savitzky-Golay filtering (see “width” keyword argument). This filter has the property of smoothing the signal around the current point before estimating the derivative.
We also pad the input beyond its boundaries (see “mode” keyword argument) so as to compensate for the reduction in length.
Since 2018, our implementation is a thin wrapper around scipy.signal.savgol_filter, preceded by some input checks.
The relevant piece of conversation between Brian and me is here:
I hope this helps!
Vincent.