Implementing a finite impulse respone (FIR) filter for computing the derivative of a discrete signal
FIR filter with impulse response $h[n] = {-\frac{1}{2}, \frac{1}{2}}$ means that :
$$y[n] = \frac{1}{2}x[n-1] - \frac{1}{2}x[n]$$
This is in some sense a mirror operation of Moving Average of two samples. This is Moving Difference (samples reversed). A High Pass Filter.
So, each output sample is the difference of current input sample with previous input sample. And, this is the result of convolution operation between $x[n]$ and $h[n]$.
But I am not sure that this is will correctly give the Derivative, since for a positively increasing discrete ramp, you would expect the discrete derivative to give positive result. Because for a increasing discrete ramp $x[n]&gt;x[n-1]$. And that FIR filter will give negative result and in addition to negative slope it will also scale the result by $\frac{1}{2}$, which is unwanted.
Correct definition of a Discrete Derivative would be in my understanding, the following:
$$\dot{x} = x[n] - x[n-1]$$
And this can be implemented using FIR filter with impulse response $h[n] = 1,-1$