Let us say that we have a discrete signal $I_n$, $n=0, 1, 2, ...$. According to Nyquist theorem the maximum frequency for such discretization is $f_{max} = 0.5$.

Now imagine that I want to calculate the derivative $D_n$ for this signal. The simplest approximation is the right hand side derivative

$$D_n = I_{n+1} - I_n$$

But what if I want to use a central derivative instead?

$$D_n = \frac{1}{2}(I_{n+1} - I_{n-1})$$

Just looking at this relation, it seems like I am increasing the sampling time from $1$ to $2$. Does this mean that before calculating central derivative I should apply low-pass filter to kill all the frequencies $f > 0.25$? Or am I being wrong and the simple fact that I am using the spacing = 2 for calculating derivative does not mean that I increase the sampling distance, because I can still calculate this derivative for each value of $n$?

No matter what the correct answer is (yes or no), can you please explain in more detail why? If the low-pass filter should be applied, can you explain if there is a method, how given discrete time relation I can infer to what degree I should smoothen the signal before using such relation?


2 Answers 2


No, you are not increasing the sampling time. The sample rate stays the same. The Central difference derivative filter is simply longer than the First difference derivative filter. A longer filter just means more delay before you get your result.

No, you should not low pass filter without a clear reason for why it is needed to meet your signal processing objectives. Your reasoning is flawed in this case, so don't apply a LPF.

Note that the Ideal derivative filter multiplies a signal's spectrum by $j\omega \cdot e^{j\omega \mu}$ in the frequency domain. In the time domain, this ideal filter is an infinitely long filter with taps:

$$h[n] = \dfrac{1}{n+\mu}\left[\cos(\pi \left[n+\mu\right])-\mathrm{sinc}(n+\mu)\right]$$


$n$ is the filter tap index in $(-\infty, \infty).$

$\mu$ corresponds to an inter-sample shift of the filter taps in the range $[0.0, 1.0]$ samples.

Given the above expression for $h[n]$, note that:

The Central difference is $h[n]$ truncated to 3 taps with $\mu = 0$.

The First difference is a scaled version of $h[n]$ truncated to 2 taps with $\mu = 0.5$.

Update to add filter magnitude responses plot

enter image description here

  • $\begingroup$ Andy, there is still one thing which bothers me. Imagine the signal 0, 1, 0, 1, 0, ... Calculation using central difference will always give derivative = 0, while actually we have 1, -1, 1, -1, ... How do you treat this issue? $\endgroup$
    – John Smith
    Commented Jan 15, 2019 at 13:17
  • $\begingroup$ That signal is at the Nyquist frequency, $F_s/2$. The central difference is a derivative filter that approximates the ideal derivative filter. That approximation is worse at high frequencies like the Nyquist frequency. You could either use a longer derivative filter (which will probably still be unsatisfactory), or sample your signal at a higher sample rate, so that the signal is in a region where the central difference filter's approximation is better. $\endgroup$
    – Andy Walls
    Commented Jan 15, 2019 at 16:47
  • $\begingroup$ isn't it exactly what Nyquist theorem says? we have calculated the central difference, which uses lower resolution and therefore got the frequency contribution at $f=0$, which did not exists in the original signal. (p.s. the signal frequency is $f=2$) $\endgroup$
    – John Smith
    Commented Jan 16, 2019 at 8:31
  • $\begingroup$ I can't tell what the absolute signal frequency is without knowing the sample rate, but I do know that a signal that alternates between two values every pair of samples is a signal at the Nyquist rate, $F_s/2$. I think you're missing the point, that the Central difference filter is far from the Ideal derivative filter near the Nyquist rate. Take a look at the plot I'm adding to the answer. At $0.5\cdot F_s$ the Central difference filter has a response of $0$, instead of $|j\pi|$ that the Ideal derivative filter has. $\endgroup$
    – Andy Walls
    Commented Jan 17, 2019 at 1:09

you do not need to apply a low-pass filter because you are applying the same transformation to each time point keeping the result. If you were to throw away one every two points in your result, then you would have to worry about the Nyquist theorem.

Another way to look at it is that the transformation that you are applying is already a high-pass filter. If you were to further low-pass, you could be left with little signal.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.