Esempio n. 1
0
# Import filter function
from neurodsp.filt import filter_signal

# Import simulation code for creating test data
from neurodsp.sim import sim_combined
from neurodsp.utils import set_random_seed, create_times

# Import utilities for loading and plotting data
from neurodsp.utils.download import load_ndsp_data
from neurodsp.plts.time_series import plot_time_series

###################################################################################################

# Set the random seed, for consistency simulating data
set_random_seed(0)

###################################################################################################

# General settings for simulations
fs = 1000
n_seconds = 5

# Set the default aperiodic exponent
exp = -1

# Generate a times vector, for plotting
times = create_times(n_seconds, fs)

###################################################################################################
# Bandpass filters
Esempio n. 2
0
# sphinx_gallery_thumbnail_number = 3

# Import numpy
import numpy as np

# Use NeuroDSP for time series simulations & analyses
from neurodsp import sim
from neurodsp.utils import create_times, set_random_seed
from neurodsp.spectral import compute_spectrum_welch
from neurodsp.plts import plot_time_series, plot_power_spectra

###################################################################################################

# Set random seed, for consistency generating simulated data
set_random_seed(21)

# Simulation Settings
n_seconds = 2
s_rate = 1000

# Compute an array of time values, for plotting, and check length of data
times = create_times(n_seconds, s_rate)
n_points = len(times)

###################################################################################################
# Frequency Representations of Aperiodic Signals
# ----------------------------------------------
#
# Let's start with aperiodic signals, and examine how different types of aperiodic
# signals are represented in the frequency domain.