braindecode.preprocessing.exponential_moving_demean#

braindecode.preprocessing.exponential_moving_demean(data, factor_new=0.001, init_block_size=None)[source]#

Perform exponential moving demeanining.

Compute the exponental moving mean \(m_t\) at time t as \(m_t=\mathrm{factornew} \cdot mean(x_t) + (1 - \mathrm{factornew}) \cdot m_{t-1}\).

Deman the data point \(x_t\) at time t as: \(x'_t=(x_t - m_t)\).

Parameters:
  • data (np.ndarray (n_channels, n_times)) –

  • factor_new (float) –

  • init_block_size (int) – Demean data before to this index with regular demeaning.

Returns:

demeaned – Demeaned data.

Return type:

np.ndarray (n_channels, n_times)