cardioception.PAT.parameters.startPhaseSequence#

cardioception.PAT.parameters.startPhaseSequence(n, phases=(0, 90, 180, 270), rng=None)[source]#

Draw the start phase of each trial, as the PAT-ECG firmware does.

The sequence is made of blocks, each a random permutation of phases. A block is drawn again when its first value equals the last value of the block before, so no start phase follows itself across a block boundary (or within a block, since a permutation holds each value once).

Parameters
nint

Length of the sequence.

phasessequence of float

The start phases, in degrees.

rngnumpy.random.Generator | None

Random generator, for reproducible sequences.

Returns
sequencelist of float

n start phases, in degrees.