Spectral Features#

brainmaze_eeg.features.spectral_features.mean_bands(args)#

Mean power spectral density - Mean spectral power for each frequency band.

Parameters:

args (dictionary) –

  • ‘psd’ (numpy.ndarray[n_samples, n_freq_samples]) - one-sided PSD

  • ’fbands’ (list of lists) - frequency bands in which the feature is to be calculated [[0.5, 4], [5, 9]]

  • ’freq’ (numpy.array[n_freq_samples]) - reference frequency array for the PSD

Returns:

  • x (list(numpy.array)) – Calculated features for individual frequency bands

  • feature_name (list(numpy.array)) – Feature names

brainmaze_eeg.features.spectral_features.mean_frequency(args)#

Mean dominant frequency - Calculates mean dominant frequency on a frequency range defined as min-to-max of frequency bands at the input. - Source: https://www.mathworks.com/help/signal/ref/meanfreq.html

Parameters:

args (dictionary) –

  • ‘psd’ (numpy.ndarray[n_samples, n_freq_samples]) - one-sided PSD

  • ’fbands’ (list of lists) - frequency bands in which the feature is to be calculated [[0.5, 4], [5, 9]]

  • ’freq’ (numpy.array[n_freq_samples]) - reference frequency array for the PSD

Returns:

  • x (list(numpy.array)) – Calculated features for individual frequency bands

  • feature_name (list(numpy.array)) – Feature names

brainmaze_eeg.features.spectral_features.median_frequency(args)#

Spectral median frequency

Parameters:

args (dictionary) –

  • ‘psd’ (numpy.ndarray[n_samples, n_freq_samples]) - one-sided PSD

  • ’fbands’ (list of lists) - frequency bands in which the feature is to be calculated [[0.5, 4], [5, 9]]

  • ’freq’ (numpy.array[n_freq_samples]) - reference frequency array for the PSD

Returns:

  • x (list(numpy.array)) – Calculated features for individual frequency bands

  • feature_name (list(numpy.array)) – Feature names

brainmaze_eeg.features.spectral_features.non_normalized_entropy(args)#

Spectral entropy (Shannon Entropy)

Parameters:

args (dictionary) –

  • ‘psd’ (numpy.ndarray[n_samples, n_freq_samples]) - one-sided PSD

  • ’fbands’ (list of lists) - frequency bands in which the feature is to be calculated [[0.5, 4], [5, 9]]

  • ’freq’ (numpy.array[n_freq_samples]) - reference frequency array for the PSD

Returns:

  • x (list(numpy.array)) – Calculated features for individual frequency bands

  • feature_name (list(numpy.array)) – Feature names

brainmaze_eeg.features.spectral_features.non_normalized_entropy_bands(args)#

Spectral entropy (Shannon Entropy)

Parameters:

args (dictionary) –

  • ‘psd’ (numpy.ndarray[n_samples, n_freq_samples]) - one-sided PSD

  • ’fbands’ (list of lists) - frequency bands in which the feature is to be calculated [[0.5, 4], [5, 9]]

  • ’freq’ (numpy.array[n_freq_samples]) - reference frequency array for the PSD

Returns:

  • x (list(numpy.array)) – Calculated features for individual frequency bands

  • feature_name (list(numpy.array)) – Feature names

brainmaze_eeg.features.spectral_features.normalized_entropy(args)#

Spectral entropy (Shannon Entropy)

Parameters:

args (dictionary) –

  • ‘psd’ (numpy.ndarray[n_samples, n_freq_samples]) - one-sided PSD

  • ’fbands’ (list of lists) - frequency bands in which the feature is to be calculated [[0.5, 4], [5, 9]]

  • ’freq’ (numpy.array[n_freq_samples]) - reference frequency array for the PSD

Returns:

  • x (list(numpy.array)) – Calculated features for individual frequency bands

  • feature_name (list(numpy.array)) – Feature names

brainmaze_eeg.features.spectral_features.normalized_entropy_bands(args)#

Spectral entropy (Shannon Entropy)

Parameters:

args (dictionary) –

  • ‘psd’ (numpy.ndarray[n_samples, n_freq_samples]) - one-sided PSD

  • ’fbands’ (list of lists) - frequency bands in which the feature is to be calculated [[0.5, 4], [5, 9]]

  • ’freq’ (numpy.array[n_freq_samples]) - reference frequency array for the PSD

Returns:

  • x (list(numpy.array)) – Calculated features for individual frequency bands

  • feature_name (list(numpy.array)) – Feature names

brainmaze_eeg.features.spectral_features.relative_bands(args)#

Relative spectral density

  • Mean spectral power for each frequency band relative to the power of a whole spectrum defined on a frequency range defined as min-to-max of frequency bands at the input.

Parameters:

args (dictionary) –

  • ‘psd’ (numpy.ndarray[n_samples, n_freq_samples]) - one-sided PSD

  • ’fbands’ (list of lists) - frequency bands in which the feature is to be calculated [[0.5, 4], [5, 9]]

  • ’freq’ (numpy.array[n_freq_samples]) - reference frequency array for the PSD

Returns:

  • x (list(numpy.array)) – Calculated features for individual frequency bands

  • feature_name (list(numpy.array)) – Feature names