pyFDN.td.RecursionState#

class pyFDN.td.RecursionState(delays, max_block_size)[source]#

Vectorised bank of block-addressable delay lines.

The state store a feedback loop is built on: get_values() reads the next block_size output samples of every line, set_values() writes the samples going back in, and advance() moves the read/write pointers. Reading before writing is what breaks the algebraic loop, so a whole block can be computed at once.

Used by Recursion (all lines the length of one processing block) and by pyFDN.process_dss() (one line per FDN delay).

Parameters:
  • delays (ArrayLike) – Length of each delay line in samples, shape (num_delays,). Must be positive.

  • max_block_size (int) – Largest block get_values() will be asked for. Must not exceed the shortest delay, otherwise a block would wrap around its own line.

__init__(delays, max_block_size)[source]#

Methods

__init__(delays, max_block_size)

advance(block_size)

Move the read/write pointers on by one block.

fill_noise([variance, rng])

Fill with zero-mean Gaussian noise of finite, non-negative variance.

get_values(block_size)

Read the next block_size samples out of every delay line.

reset()

Zero the buffers and rewind the pointers.

set_lines(lines)

Overwrite the whole content of every delay line.

set_values(block)

Write a (block_size, num_delays) block into the slots just read.

advance(block_size)[source]#

Move the read/write pointers on by one block.

Return type:

None

fill_noise(variance=1.0, *, rng=None)[source]#

Fill with zero-mean Gaussian noise of finite, non-negative variance.

Pass rng (a Generator or an integer seed) for reproducible noise. Zero variance clears the lines without moving their read positions.

Return type:

None

get_values(block_size)[source]#

Read the next block_size samples out of every delay line.

Return type:

ndarray

reset()[source]#

Zero the buffers and rewind the pointers.

Return type:

None

set_lines(lines)[source]#

Overwrite the whole content of every delay line.

lines[i] holds exactly delays[i] samples in output order: lines[i][k] is what line i emits k samples from now. All samples must be finite. Invalid input leaves the state unchanged.

Return type:

None

set_values(block)[source]#

Write a (block_size, num_delays) block into the slots just read.

Return type:

None