BlockWerk Documentation
⚡

Discrete TF

Discrete

Implements a discrete-time transfer function H(z) = B(z)/A(z) using the Direct Form II Transposed structure. Coefficients are specified as space-separated values in descending powers of z.

Simulate in BlockWerk

Interactive sandbox directly in your browser — zero installation, WASM-powered.

Simulate in BlockWerk →

Mathematical Model

H(z)=b0+b1z−1+⋯+bmz−m1+a1z−1+⋯+anz−nH(z) = \frac{b_0 + b_1 z^{-1} + \dots + b_m z^{-m}}{1 + a_1 z^{-1} + \dots + a_n z^{-n}}

Coefficients are given in descending powers of z. Example: numerator 1 0.5 means z + 0.5.

Inputs & Outputs

Direction ID Label Type Status
→ In in In number Required
→ In reset Reset number Optional
← Out out Out number Output

Parameters

Parameters Label Type Default Description
numerator Numerator B(z) polynomial 1
denominator Denominator A(z) polynomial 1 -0.5
sampleTime Sample Time number 0.01
initialCondition Initial Condition number 0

Usage Examples

Transfer FunctionNumeratorDenominator
First-order LP: 0.5/(z - 0.5)0 0.51 -0.5
Moving average: (1 + z⁻¹)/20.5 0.51
Unit delay: z⁻¹0 11 0

Remarks & Best Practices

  • Causality: Numerator order should not exceed denominator order for proper real-time implementation
  • Initial transients: Filter states start at zero; first few output samples reflect start-up transient behaviour
  • Sample time: Must match or be a multiple of the simulation's base sample time
  • Coefficient format: Coefficients are space-separated in descending powers of z; trailing zeros in the numerator are significant
  • Direct Form II Transposed: Numerically robust implementation with fewer delay states than Direct Form I

Related Components