Skip to content

Resampling

If you have acquired data with a very high sampling frequency (e.g. 2 kHz) you will likely want to downsample to lighten up the size of the files you are working with (pragmatics) If you are interested in typical analysis (up to 120 Hz) you can typically resample your data down to 500 Hz without preventing reliable time-frequency exploration of your data.

raw_resample_sfreq module-attribute

Python
raw_resample_sfreq: float | None = None

Specifies at which sampling frequency the data should be resampled. If None, then no resampling will be done.

Example
Python
raw_resample_sfreq = None  # no resampling
raw_resample_sfreq = 500  # resample to 500Hz
Pipeline steps using this setting

The following steps are directly affected by changes to raw_resample_sfreq:

  • preprocessing/_04_frequency_filter
  • preprocessing/_06a1_fit_ica
  • preprocessing/_06a2_find_ica_artifacts

epochs_decim module-attribute

Python
epochs_decim: int = 1

Says how much to decimate data at the epochs level. It is typically an alternative to the resample_sfreq parameter that can be used for resampling raw data. 1 means no decimation.

Good Practice / Advice

Decimation requires to lowpass filtered the data to avoid aliasing. Note that using decimation is much faster than resampling.

Example
Python
epochs_decim = 1  # no decimation
epochs_decim = 4  # decimate by 4, i.e., divide sampling frequency by 4
Pipeline steps using this setting

The following steps are directly affected by changes to epochs_decim:

  • preprocessing/_06a1_fit_ica
  • preprocessing/_06a2_find_ica_artifacts
  • preprocessing/_06b_run_ssp
  • preprocessing/_07_make_epochs