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:
- waveform
array The input signal to be processed.
- sfreq
float Sampling frequency (in Hz).
- phase_lag
float Average phase lag to apply to the waveform in radians.
- coh
float The desired level of coherence between input and output time series.
- fmin
float Lower cutoff frequency of the frequency band of interest (in Hz).
- fmax
float 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_state
None(default) orint Seed for the random number generator. If None (default), results will vary between function calls. Use a fixed value for reproducibility.
- waveform
- Returns:
- out
array, shape (n_times,) The phase-coupled waveform.
- out
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#
Phase-phase coupling using shifted copy with noise