neurodsp.sim.combined.sim_modulated_signal¶
- neurodsp.sim.combined.sim_modulated_signal(n_seconds, fs, sig_func, sig_params, mod_func, mod_params)[source]¶
Simulate an amplitude modulated signal.
- Parameters
- n_secondsfloat
Simulation time, in seconds.
- fsfloat
Signal sampling rate, in Hz.
- sig_funcstr
Name of the function to use to simulate the signal.
- sig_paramdictionary
Parameters for the signal generation function.
- mod_funccallable
Name of the function to use to simulate the modulating signal.
- mod_paramsdictionary
Parameters for the modulation function.
- Returns
- msig1d array
Amplitude modulated signal.
Notes
String labels for sig_func & mod_func can be any sim function available in the module.
Examples
Simulate an oscillatory signal that is amplitude modulated for a slower oscillation:
>>> n_seconds = 10 >>> fs = 500 >>> msig_osc = sim_modulated_signal(n_seconds, fs, ... 'sim_oscillation', {'freq' : 10}, ... 'sim_oscillation', {'freq' : 1})
Simulate an oscillatory signal that is amplitude modulated by a 1/f drift:
>>> n_seconds = 10 >>> fs = 500 >>> msig_ap = sim_modulated_signal(n_seconds, fs, ... 'sim_oscillation', {'freq' : 10}, ... 'sim_powerlaw', {'exponent' : -1})