neurodsp.sim.combined.sim_peak_oscillation

neurodsp.sim.combined.sim_peak_oscillation(sig_ap, fs, freq, bw, height)[source]

Simulate a signal with an aperiodic component and a specific oscillation peak.

Parameters
sig_ap1d array

The timeseries of the aperiodic component.

fsfloat

Sampling rate of sig_ap.

freqfloat

Central frequency for the gaussian peak in Hz.

bwfloat

Bandwidth, or standard deviation, of gaussian peak in Hz.

heightfloat

Relative height of the gaussian peak at the central frequency freq. Units of log10(power), over the aperiodic component.

Returns
sig1d array

Time series with desired power spectrum.

Notes

  • This function creates a time series whose power spectrum consists of an aperiodic component

and a gaussian peak at freq with standard deviation bw and relative height. - The periodic component of the signal will be sinusoidal.

Examples

Simulate a signal with aperiodic exponent of -2 & oscillation central frequency of 20 Hz:

>>> from neurodsp.sim import sim_powerlaw
>>> fs = 500
>>> sig_ap = sim_powerlaw(n_seconds=10, fs=fs, exponent=-2.0)
>>> sig = sim_peak_oscillation(sig_ap, fs=fs, freq=20, bw=5, height=7)