  The problem of differentiating a function with bounded second derivative in
the presence of bounded measurement noise is considered in both continuous-time
and sampled-data settings. Fundamental performance limitations of causal
differentiators, in terms of the smallest achievable worst-case differentiation
error, are shown. A robust exact differentiator is then constructed via the
adaptation of a single parameter of a linear differentiator. It is demonstrated
that the resulting differentiator exhibits a combination of properties that
outperforms existing continuous-time differentiators: it is robust with respect
to noise, it instantaneously converges to the exact derivative in the absence
of noise, and it attains the smallest possible -- hence optimal -- upper bound
on its differentiation error under noisy measurements. For sample-based
differentiators, the concept of quasi-exactness is introduced to classify
differentiators that achieve the lowest possible worst-case error based on
sampled measurements in the absence of noise. A straightforward sample-based
implementation of the proposed linear adaptive continuous-time differentiator
is shown to achieve quasi-exactness after a single sampling step as well as a
theoretically optimal differentiation error bound that, in addition, converges
to the continuous-time optimal one as the sampling period becomes arbitrarily
small. A numerical simulation illustrates the presented formal results.
