# 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 :**&#x20;

The data is high-pass filtered before performing the fourier transform. We use the following coefficients ( 3dB at 0.5Hz filter):

```html
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:&#x20;

```html
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 :**&#x20;

Our normalization uses python and numpy.&#x20;

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[0]) * 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[0]
    fourier_transform_norm = (2 x fourier_transform) / hanning_window.shape[0]
    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))

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://emotiv.gitbook.io/emotivpro-analyzer/understanding-analyzer-outputs/band-power-calculation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
