Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-did 3 notebooks #5

Merged
merged 6 commits into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
287 changes: 287 additions & 0 deletions 0-Introduction-Jupyter.ipynb

Large diffs are not rendered by default.

484 changes: 484 additions & 0 deletions 6-Colored-Noise.ipynb

Large diffs are not rendered by default.

217 changes: 217 additions & 0 deletions 7-Noise-Filter-Band-Misinterpretations.ipynb

Large diffs are not rendered by default.

Binary file added dat/cba1ff01.cnt
Binary file not shown.
Binary file renamed emodat.mat → dat/emodat.npy
Binary file not shown.
Binary file added img/HowPowerSpectraGoWrong.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/binder_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/github_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/jupyter_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/sky5.en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added utils/__pycache__/plts.cpython-36.pyc
Binary file not shown.
30 changes: 30 additions & 0 deletions utils/plts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Tools and utilities for plotting."""

import matplotlib.pyplot as plt

from fooof.plts.templates import plot_spectrum

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

def plot_fm_shading(fm, cens, bws):
"""Plot a FOOOF power spectrum with shaded regions.

Parameters
----------
fm : FOOOF() object
FOOOF object with power spectrum data to plot.
cens : list of float
List of center values to shade around.
bws : list of float
List of ranges to plot +/- each center regions.
"""

plot_spectrum(fm.freqs, fm.power_spectrum)

# Add shading +/- BW around each provided CEN.
# Note: m is a potential scaling of BW. Currently not-exposed (hard set to 1).
m = 1
for cen, bw in zip(cens, bws):
plt.axvspan(cen, cen, color='g')
plt.axvspan(cen-(m*bw), cen+(m*bw), color='r', alpha=0.2, lw=0)