sigma_delta
Builtin index · Signal processing
result = sigma_delta(x)
Input: x · Output: result
What it is
x: a length-N vector or Signal.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = sigma_delta(x) | x vector or Signalnot documented yet | Signal Signalpreserving x's Fs when it's a Signal | Returns a same-length vector or Signal (preserving x's Fs when it's a Signal), each sample +1/-1. First-order (error-feedback) 1-bit noise-shaping quantizer: binarizes x, pushing quantization error to higher frequencies instead of spreading it evenly like plain sign(x) — the technique behind "DIBS-ΔΣ" excitation signals (multisine(...) |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
fs = 1000
tone = sine(50, fs, 20)
bits = sigma_delta(tone) # 1-bit noise-shaping quantizer
print("sigma_delta output range: [{min(bits)}, {max(bits)}]")
s = signal(0 to 9, 10)
trimmed = signal_slice_time(s, 0.2, 0.6) # same operation `cut` is the friendlier name for
print("signal_slice_time(0.2, 0.6) -> {trimmed}")
sigma_delta output range: [-1, 1] signal_slice_time(0.2, 0.6) -> signal(Fs=10) [2, 3, 4, 5, 6]
from signal-processing
How it works
sigma_delta(x) — a first-order (error-feedback) 1-bit noise-shaping quantizer: exact 1-bit binarization of x that pushes quantization error to higher frequencies instead of spreading it evenly (sign(x)'s own behavior) — the standard technique behind "DIBS-ΔΣ" excitation signals (multisine(...) |> sigma_delta) and 1-bit DACs generally. A signal's own Fs survives (same convention as diff/cumsum) since this doesn't change the sample rate, only re-quantizes the values.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.