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 nextblock_sizeoutput samples of every line,set_values()writes the samples going back in, andadvance()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 bypyFDN.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 blockget_values()will be asked for. Must not exceed the shortest delay, otherwise a block would wrap around its own line.
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_sizesamples 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.- 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:
- get_values(block_size)[source]#
Read the next
block_sizesamples out of every delay line.- Return type: