DiscreteDerivative Block
Discrete-time derivative. Computes the rate of change: (u[n] - u[n-1]) / Ts.
Open DiscreteDerivative in BlockWerk →# DiscreteDerivative Block
Description
Computes the discrete-time derivative (backward difference) of the input signal. Outputs zero on the first sample.
Mathematical Model
y[n] = (u[n] - u[n-1]) / T
y[0] = 0
where y[n] is the current output, u[n] the current input, and T the sample time.
Parameters
sampleTime
Discrete sample period (seconds).
Remarks
- Noise amplification: Differentiation amplifies high-frequency noise; pre-filter noisy signals with Smooth or a low-pass filter
- First sample: Output is zero on the first simulation step (no prior input value available)
- Sample time: Smaller sample times increase derivative gain; the output is scaled by 1/T
- Backward difference: This is the standard backward Euler differentiator — causal and computationally efficient
- For continuous design: Use the Derivative block (with built-in filtering) for smoother continuous differentiation
See Also
- Derivative: Continuous-time derivative
- DiscreteIntegrator: Discrete-time integrator (inverse operation)