neurodsp.sim.cycles.sim_asym_harmonic_cycle

neurodsp.sim.cycles.sim_asym_harmonic_cycle(n_seconds, fs, phi, n_harmonics)[source]

Simulate an asymmetrical cycle as a sum of harmonics.

Parameters
n_secondsfloat

Length of cycle window in seconds.

fsfloat

Sampling frequency of the cycle simulation.

phifloat

Phase at each harmonic.

n_harmonicsint

Number of harmonics to sum across.

Returns
cycle1d array

Simulated asymmetrical harmonic cycle.

Notes

  • This asymmetric cycle is implemented as Equation 10 of [1].

\[cycle = \sum_{j=1}^{j} \dfrac{1}{j^2} \cdot cos(j2\pi ft)+(j-1)*\phi\]

References

1

Lozano-Soldevilla, D., Huurne, N. T., & Oostenveld, R. (2016). Neuronal Oscillations with Non-sinusoidal Morphology Produce Spurious Phase-to-Amplitude Coupling and Directionality. Frontiers in Computational Neuroscience, 10. DOI: https://doi.org/10.3389/fncom.2016.00087

Examples

Simulate an asymmetrical cycle as the sum of harmonics:

>>> cycle = sim_asym_harmonic_cycle(1, 500, phi=1, n_harmonics=1)