Delay¶
- class pathsim.blocks.delay.Delay(tau=0.001, sampling_period=None)[source]¶
Bases:
BlockDelays the input signal by a time constant ‘tau’ in seconds.
Supports two modes of operation:
Continuous mode (default,
sampling_period=None): Uses an adaptive interpolating buffer for continuous-time delay.\[\begin{split}y(t) = \begin{cases} x(t - \tau) & , t \geq \tau \\ 0 & , t < \tau \end{cases}\end{split}\]Discrete mode (
sampling_periodprovided): Uses a ring buffer with scheduled sampling events for N-sample delay, whereN = round(tau / sampling_period).\[y[k] = x[k - N]\]Note
In continuous mode, the internal adaptive buffer uses interpolation for the evaluation. This is required to be compatible with variable step solvers. It has a drawback however. The order of the ode solver used will degrade when this block is used, due to the interpolation.
Note
This block supports vector input, meaning we can have multiple parallel delay paths through this block.
Example
Continuous-time delay:
#5 time units delay D = Delay(tau=5)
Discrete-time N-sample delay (10 samples):
D = Delay(tau=0.01, sampling_period=0.001)
- Parameters:
- _buffer¶
internal interpolatable adaptive rolling buffer (continuous mode)
- Type:
- _ring¶
internal ring buffer for N-sample delay (discrete mode)
- Type:
deque
- property tau¶
- property sampling_period¶
- reset()[source]¶
Reset the blocks inputs and outputs and also its internal solver, if the block has a solver instance.
- update(t)[source]¶
Evaluation of the buffer at different times via interpolation (continuous) or ring buffer lookup (discrete).
- Parameters:
t (float) – evaluation time