How to compute the power bands of an eeg signal using python? so I have an eeg signal (edf format) that has 25 channels and 248832 entries, sampling frequency of 512Hz. I have to compute the frequency bands: 
– Delta: 0.1-4Hz
– Theta: 4-8Hz 
– Alpha: 8-12Hz 
– Sigma: 12-16Hz 
– Beta: 16-36Hz 
– Gamma: >36Hz 
and plot them accordingly. I am using Python for this with scipy, numpy, etc. and I should get to something like this:



Does anyone have any point-outs/ideeas/tutorials that could help me compute the bands and then get such a plot(probably a histogram)? Thanks!
Here is some code that may solve your problem:

from scipy.io import loadmat
import scipy
import numpy as np
from pylab import *
import matplotlib.pyplot as plt

eeg = loadmat("mydata.mat");
eeg1=eeg['eeg1'][0]    
fs = eeg['fs'][0][0]
fft1 = scipy.fft(eeg1)
f = np.linspace (0,fs,len(eeg1), endpoint=False)
plt.figure(1)
plt.plot (f, abs (fft1))
plt.title ('Magnitude spectrum of the signal')
plt.xlabel ('Frequency (Hz)')
show()


You can also check this other link:

http://forrestbao.blogspot.pt/2009/10/eeg-signal-processing-in-python-and.html