Average Power Spectral Density (APSD)

Description

This module implements the Average Power Spectral Density (APSD) feature extractor, which computes the average power in specific frequency bands of EEG signals. This feature is commonly used in BCI applications to characterize brain activity.

The APSD is calculated using Welch’s method, which estimates the power spectral density by dividing the signal into overlapping segments and averaging their periodograms.

Class

class bciflow.modules.fe.apsd.apsd(flating: bool = False)[source]

Bases: object

flating

If True, the output data is returned in a flattened format (default is False).

Type:

bool

fit(eegdata)[source]

This method does nothing, as the APSD feature extractor does not require training.

Parameters:

eegdata (dict) – The input data.

Return type:

self

fit_transform(eegdata) dict[source]

This method combines fitting and transforming into a single step. It returns a dictionary with the transformed data.

Parameters:

eegdata (dict) – The input data.

Returns:

output – The transformed data.

Return type:

dict

transform(eegdata) dict[source]

This method computes the average power spectral density (APSD) for each trial, band, and channel in the input data. The result is stored in the dictionary under the key ‘X’.

Parameters:

eegdata (dict) – The input data.

Returns:

output – The transformed data.

Return type:

dict