meegsim.coupling.ppc_shifted_copy_with_noise#

meegsim.coupling.ppc_shifted_copy_with_noise(waveform, sfreq, phase_lag, coh, fmin, fmax, band_limited=True, random_state=None)[source]#

Generate a time series with desired level of coherence with the provided waveform in a frequency band of interest.

The time series are generated by (1) applying a constant phase shift to the input waveform and (2) mixing it with a specific amount of narrowband noise. This function only supports within-frequency coupling.

Parameters:
waveformarray

The input signal to be processed.

sfreqfloat

Sampling frequency (in Hz).

phase_lagfloat

Average phase lag to apply to the waveform in radians.

cohfloat

The desired level of coherence between input and output time series.

fminfloat

Lower cutoff frequency of the frequency band of interest (in Hz).

fmaxfloat

Upper cutoff frequency of the frequency band of interest (in Hz).

band_limitedbool

Whether to limit coupling only to the frequency band of interest (True by default). If set to False, coupling will be the same for all frequencies, resulting in a flat connectivity spectra. However, the signal outside of the frequency band of interest will be modified negligibly.

random_stateNone (default) or int

Seed for the random number generator. If None (default), results will vary between function calls. Use a fixed value for reproducibility.

Returns:
outarray, shape (n_times,)

The phase-coupled waveform.

Notes

The desired value of coherence and phase lags are obtained only on average across multiple simulations. For every individual output, coherence and phase lag might deviate from the desired values: The lower the requested coherence is, the higher is the variance of the output. For more information, see this example.

Examples using meegsim.coupling.ppc_shifted_copy_with_noise#

Random state and reproducibility

Random state and reproducibility

Phase-phase coupling using shifted copy with noise

Phase-phase coupling using shifted copy with noise