pyFDN.td.RingModulator#

class pyFDN.td.RingModulator(channels, mod_freq, mod_amp, fs, active_channels)[source]#

Stateful, controllable ring modulator, y[n, c] = mod_amp * x[n, c] * sin(2 * pi * mod_freq * n / fs), applied to active_channels only; the rest pass through unchanged.

Multiplying by a sine shifts the spectrum of the active channels by +-mod_freq rather than adding harmonics on top of it, so the effect reads as tremolo at low mod_freq and as an inharmonic, bell-like retuning once mod_freq enters the audible range. A unit-amplitude sine carries only half the power of the signal it multiplies, so mod_amp = sqrt(2) keeps the operator energy-preserving. The modulation phase runs continuously across filter() calls, tracked by sample_index.

__init__(channels, mod_freq, mod_amp, fs, active_channels)[source]#

Methods

__init__(channels, mod_freq, mod_amp, fs, ...)

filter(block)

Filter one block and advance internal state.

process(signal, *[, squeeze])

Filter a whole signal in one call, from the current state.

reset()

Clear internal state (no-op for stateless operators).

Attributes

in_channels

out_channels

filter(block)[source]#

Filter one block and advance internal state.

Return type:

ndarray

reset()[source]#

Clear internal state (no-op for stateless operators).

Return type:

None