Oscillators
- class tiliqua.dsp.SawNCO(*args, src_loc_at=0, **kwargs)
Sawtooth Numerically Controlled Oscillator.
Frequency is linearly proportional to
i.payload.freq_inc, with optional phase modulation oni.payload.phase. One output sample per input sample.Often a saw is used routed into a waveshaper for arbitrary waveform types.
- Members:
i (
In(stream.Signature(data.StructLayout)) – Input stream -freq_inc(linear frequency) andphase(phase offset). One output sample is produced for each input sample.o (
Out(stream.Signature(ASQ))) – Output stream, values sweep fromASQ.min()toASQ.max().
- class tiliqua.dsp.WhiteNoise(*args, src_loc_at=0, **kwargs)
Simple white noise generator based on an LFSR.
See: https://www.musicdsp.org/en/latest/Synthesis/216-fast-whitenoise-generator.html
- Members:
o (
Out(stream.Signature(ASQ))) – Output stream of white noise. Throttled by output backpressure ono.ready.
- class tiliqua.dsp.DWO(*args, src_loc_at=0, **kwargs)
Digital Waveguide Oscillator.
Emits a fixed frequency and amplitude sine wave, without needing a sine LUT. Instead, only uses 2 registers, 1 multiply, 3 adds.
This is not easy to modulate, but it is an interesting way to achieve a high-fidelity sine wave with minimal resources.
- For details, see Fig. 3 from:
https://ccrma.stanford.edu/~jos/wgo/Second_Order_Waveguide_Filter.html
- Members:
o (
Out(stream.Signature(ASQ))) – Output stream of sinusoid samples. Throttled by output backpressure ono.ready.
- __init__(sq=None, macp=None, c=0.99)
- sqfixed.SQ
Fixed-point type of internal waveguide calculations.
- macpmac.MAC
(optional) shared multiplier provider.
- cfloat
Tuning coefficient
C = cos(2*pi*f/fs)