tensorpac.methods.swap_blocks¶
-
tensorpac.methods.
swap_blocks
(pha, amp, random_state=None)[source]¶ Compute surrogates by swapping amplitudes time blocks.
This function destroys the relation between the phase and the amplitude in order to correct for PAC that could be obtained by chance. To this end, this function cut the amplitude at a random time point. Then, both time blocks are swapped. For a more detailed description, see [2].
- Parameters
- pha, amparray_like
Respectively the arrays of phases of shape (n_pha, …, n_times) and the array of amplitudes of shape (n_amp, …, n_times).
- random_stateint | None
Fix the random state of the machine for reproducible results.
- Returns
- pha, amparray_like
The phase and amplitude to use to compute the distribution of permutations
References
Bahramisharif et al. 2013 [2]