Mixing

class tiliqua.dsp.MatrixMix(*args, src_loc_at=0, **kwargs)

MatrixMix takes a stream of samples i_channels wide and emits a stream o_channels wide. The input channels are multiplied by a matrix of i_channels*o_channels coefficients, which may be static or dynamically updated through gateware.

A single multiplier is shared, where total latency is of the order 2*i_channels*o_channels from input to output.

All coefficients must fit inside the self.ctype declared below.

Coefficients may be updated dynamically, depending on coeff_update:

  • CoeffUpdate.NONE: No update port.

  • CoeffUpdate.XY: Stream of (o_x, i_y, v) updates.

  • CoeffUpdate.BLOCK: Block stream, mapped row-major to coefficients.

Members:
  • i (In(stream.Signature(data.ArrayLayout(ASQ, i_channels)))) – Input stream for sending sample arrays to the mixer.

  • o (In(stream.Signature(data.ArrayLayout(ASQ, o_channels)))) – Output stream for fetching sample arrays from the mixer.

  • c (In(stream.Signature(...))) – Optional coefficient update port, type depends on self.coeff_update.

__init__(i_channels, o_channels, coefficients, coeff_update=CoeffUpdate.XY, ctype=mac.SQNative)
i_channelsint

Number of input channels.

o_channelsint

Number of output channels

coefficients[[float]]

Nested array of static matrix coefficients, used as initial values of the coefficient memory.

coeff_updateCoeffUpdate

Whether a dynamic coefficient update port should be added (see above).

ctypefixed.SQ

Fixed-point type of coefficients in the coefficient ROM.