Skip to content

Commit

Permalink
Show the plots
Browse files Browse the repository at this point in the history
  • Loading branch information
curiositry committed Sep 12, 2016
1 parent bcb9fe1 commit 2a00f25
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions analyze_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EEGrunt

# Required settings
# Required settings

# Data source. Options:
# 'openbci' for data recorded with OBCI GUI;
Expand All @@ -25,44 +25,45 @@
# Possible values are 'show' and 'save'
EEG.plot = 'show'


# Load the EEG data
EEG.load_data()


for channel in EEG.channels:

EEG.load_channel(channel)

print("Processing channel "+ str(EEG.channel))

# Removes OpenBCI DC offset
EEG.remove_dc_offset()

# Notches 60hz noise (if you're in Europe, switch to 50Hz)
EEG.notch_mains_interference()

# Make signal plot
EEG.signalplot()

# Crunches spectrum data and stores as EEGrunt attribute(s) for reuse
EEG.get_spectrum_data()
# Returns bandpassed data

# Returns bandpassed data
# (uses scipy.signal butterworth filter)
# EEG.data = EEG.bandpass(start,stop)
EEG.data = EEG.bandpass(start,stop)

# Make Spectrogram
# Make Spectrogram
EEG.spectrogram()

# Line graph of amplitude over time for a given frequency range.
# Arguments are start frequency, end frequency, and label
EEG.plot_band_power(8,12,"Alpha")

# Power spectrum
EEG.plot_spectrum_avg_fft()

# Plot coherence fft (not tested recently...)
# s1 = bandpass(seginfo["data"][:,1-1], config['band'])
# s2 = bandpass(seginfo["data"][:,8-1], config['band'])
# plot_coherence_fft(s1,s2,"1","8")

# When all's said and done, show the plots
EEG.showplots()

0 comments on commit 2a00f25

Please sign in to comment.