neurodsp.sim.cycles.sim_asine_cycle¶
- neurodsp.sim.cycles.sim_asine_cycle(n_seconds, fs, rdsym, side='both')[source]¶
Simulate a cycle of an asymmetric sine wave.
- Parameters
- n_secondsfloat
Length of cycle window in seconds. Note that this is NOT the period of the cycle, but the length of the returned array that contains the cycle, which can be (and usually is) much shorter.
- fsfloat
Sampling frequency of the cycle simulation.
- rdsymfloat
Rise-decay symmetry of the cycle, as fraction of the period in the rise time, where: = 0.5 - symmetric (sine wave) < 0.5 - shorter rise, longer decay > 0.5 - longer rise, shorter decay
- side{‘both’, ‘peak’, ‘trough’}
Which side of the cycle to make asymmetric.
- Returns
- cycle1d array
Simulated asymmetric cycle.
Examples
Simulate a 2 Hz asymmetric sine cycle:
>>> cycle = sim_asine_cycle(n_seconds=0.5, fs=500, rdsym=0.75)