Quantizer
DiscontinuousRounds 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.
Mathematical Model
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
- MathFunction: round/floor/ceil for integer rounding
- DeadZone: Zero-output band around zero