BlockWerk Documentation
▦

Quantizer

Discontinuous

Rounds the input signal to the nearest multiple of a specified interval, producing a staircase-like output. Models ADC resolution, digital sensor quantization, and discrete-level systems.

Simulate in BlockWerk

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

Simulate in BlockWerk →

Mathematical Model

y(t)=q⋅round(u(t)q)y(t) = q \cdot \text{round}\left(\frac{u(t)}{q}\right)

Inputs & Outputs

Direction ID Label Type Status
→ In in Input number Required
← Out out Output number Output

Parameters

Parameters Label Type Default Description
mode Mode select resolution Resolution: specify quantization interval directly. ADC: specify min, max, and bit depth.
interval Quantization Interval number 1 Used in Resolution mode
minValue Min Value number 0 Minimum input range (ADC mode)
maxValue Max Value number 5 Maximum input range (ADC mode)
bits Number of Bits number 8 Bit depth for ADC quantization (ADC mode)

Usage Examples

  • Zie de ingebouwde voorbeelden in de handleiding voor een demonstratie van dit blok.

Remarks & Best Practices

  • Quantisation error: The difference between input and output is at most ±interval/2; smaller intervals reduce error but increase the number of output levels
  • ADC simulation: Use Quantizer to model analog-to-digital converter resolution (e.g., interval = 5/1024 for a 10-bit ADC with 5V reference)
  • Staircase output: The output changes in discrete steps of the interval value, producing a characteristic staircase waveform
  • Zero-centred: Quantization is symmetric around zero — negative inputs step through negative multiples of the interval
  • Performance: Negligible computational cost; safe for high-sample-rate simulation

Related Components