neurodsp.sim.cycles.sim_sawtooth_cycle

neurodsp.sim.cycles.sim_sawtooth_cycle(n_seconds, fs, width)[source]

Simulate a cycle of a sawtooth wave.

Parameters
n_secondsfloat

Length of cycle window in seconds.

fsfloat

Sampling frequency of the cycle simulation.

widthfloat

Width of the rising ramp as a proportion of the total cycle.

Returns
cycle1d array

Simulated sawtooth cycle.

Examples

Simulate a symmetric cycle of a sawtooth wave:

>>> cycle = sim_sawtooth_cycle(n_seconds=0.25, fs=500, width=0.5)