# Band Power calculation

The EmotivPRO Analyzer allows the following operations that involve the pre-processing and bandpower extraction.
• Basic EEG processing
• Basic EEG processing and Transformation
• Individual Band-Power Reports
• Band Power Report
Limit slew rate :
This limits the step change between 2 samples. Analyzer applies a slew rate limitation at 30 µV.
High-pass filter :
The data is high-pass filtered before performing the fourier transform. We use the following coefficients ( 3dB at 0.5Hz filter):
filter_coeffs": {
"b": [0.96588528974407006000, -1.93177057948814010000, 0.96588528974407006000],
"a": [1.00000000000000000000, -1.93060642721966810000, 0.93293473175661223000]}
Re-referencing: Analyzer supports three ways of re-referencing the EEG data. Interquartile mean (IQM), Median, and Mean.
Hanning Window : Users can choose a window size of N (e.g. 256) samples and this window by M (e.g. 16) samples to create the new window.
The exact implementation of the Hanning window we use:
hanning_window = []
for i in range(256):
hanning_window.append(0.5 * (1 - np.cos((2.0 * np.pi * (i + 1)) / (256 + 1))))
Band Powers and Normalization :
Our normalization uses python and numpy.
Multiplying the Hanning window by 2 (as the window reduces the amplitude of the Fourier transform by a factor of 2 and divide the output of the fft by the window length)
We also subtract the mean of the data for each epoch/window as the DC value is not usable and only distorts the Fourier transform of the lower frequencies.
hanning_window = np.hanning(eeg.shape) * 2
eeg_norm = eeg - np.mean(eeg, axis=0)
eeg_fft = (eeg_norm.T * hanning_window).T
fourier_transform = fft(eeg_fft, axis=0)/eeg_fft.shape
fourier_transform_norm = (2 x fourier_transform) / hanning_window.shape
eeg_fft_square_3d = np.absolute(fourier_transform_norm)**2
band = list(range(16, 25))
band_power = np.sum(eeg_fft_square_3d[band, :, :], axis=0) / len(band)
//Finally EmotivPRO Analyzer will output band power in decibels (dB):
band_power_db = 10*np.log10(band_power))