tensorpac.methods.swap_pha_amp

tensorpac.methods.swap_pha_amp(pha, amp, random_state=None)[source]

Compute surrogates by swapping phase / amplitude trials.

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 reorganize the relation from trial-to-trial between the phase and the amplitude (swapping). In particular, in that case it is the trials of the phase that are randomly swapped and the amplitude is leaved unchanged. For a more detailed description, see [11]

Parameters
pha, amparray_like

Respectively the arrays of phases of shape (n_pha, n_trials, …, n_times) and the array of amplitudes of shape (n_amp, n_trials, …, 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

Tort et al. 2010 [11]