# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Find the numerical derivative of a list of values or pairs of values

Contributed by:
Jon McLoone

ResourceFunction["ListD"][ finds the derivative of a list of | |

ResourceFunction["ListD"][ finds the derivative of a list of |

Available choices for method are "Forward", "Backward", "Center" or "Fourier".

"Forward", "Backward" and "Center" all use linear fitting on a window of points with the given relative position to the point being considered.

With "WindowSize"→1 the values computed by "Forward", "Backward" and "Center" are simply the quotient of differences in the values.

The "Fourier" method uses an FFT based method but is only supported for regularly spaced points.

One dimensional data is assumed to be regularly spaced with unit spacing.

ResourceFunction["ListD"] accepts the following option:

"WindowSize" | 1 | the number of extra points to use to find a linear fit |

Find the derivative of data sampled from a function:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

Find the derivative of {*x*,*y*} data sampled from a function:

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

In[6]:= |

Out[6]= |

The default method, "Center" generates new points between each of the original *x*-values using values from both sides to approximate the derivative:

In[7]:= |

Out[7]= |

The method, "Forward" generates new points at each of the original *x*-values using the next values to determine the derivative:

In[8]:= |

Out[8]= |

The method, "Backward" generates new points at each of the original *x*-values using the previous values to determine the derivative:

In[9]:= |

Out[9]= |

The method, "Fourier" is appropriate for larger sets of oscillatory data:

In[10]:= |

In[11]:= |

Out[11]= |

A small amount of noise in data can create significant errors in ListD:

In[12]:= |

Out[13]= |

By increasing the "WindowSize" the derivative is established by from the best local fit to the points:

In[14]:= |

Out[14]= |

Smoothing the data first to remove noise has a similar effect but often produces less smooth results for the same amount of smoothing:

In[15]:= |

Out[15]= |

The "Fourier" method is only supported for regularly sampled data:

In[16]:= |

Out[16]= |

- 1.0.1 – 01 April 2022
- 1.0.0 – 28 March 2022

This work is licensed under a Creative Commons Attribution 4.0 International License