Simulations
Contents
Simulations¶
This section introduces and describes the simulations used in this project.
Simulations include:
time domain simulations
power spectrum simulations
Also, this section overview the main simulation uses:
using simulations to examine and quantify properties of individual methods
using simulations to compare the results of a set of methods
# Setup notebook state
from nbutils import setup_notebook; setup_notebook()
# Import simulation functions from neurodsp and specparam(fooof)
from neurodsp.sim import sim_powerlaw
from neurodsp.utils import set_random_seed
from neurodsp.plts import plot_time_series, plot_power_spectra
from fooof.sim import gen_power_spectrum
Settings¶
# Set random seed
set_random_seed(111)
Time Domain Simulations¶
First, we can simulate 1 second (at 500 Hz) of an aperiodic time series.
# Simulate a time series
sig = sim_powerlaw(n_seconds=1, fs=500, exponent=-1)
# Visualize a simulated neural time series
plot_time_series(None, sig)
Power Spectrum Simulations¶
Next, we can simulate an example power spectrum, with an aperiodic component, and an alpha peak
# Simulate a power spectrum
freqs, powers = gen_power_spectrum([3, 40], [1, 1], [10, 0.3, 1], nlv=0.025)
# Plot the power spectrum
plot_power_spectra(freqs, powers, lw=5, ylabel='Power', colors='black')
Simulations¶
In the next notebooks, we will step through the details of these simulations, and how they are used to systematically test different methods.