eeg_downsample: Downsample EEG data

View source: R/signal_processing.R

eeg_downsampleR Documentation

Downsample EEG data

Description

Downsample a signal_tbl by a factor q, using an FIR or IIR filter. This is a wrapper for decimate from the gsignal package, see its documentation for details.

Usage

eeg_downsample(
  .data,
  .q = 2,
  .max_sample = NULL,
  .n = if (.ftype == "iir") 8 else 30,
  .ftype = "iir",
  .multiple_times = FALSE,
  ...
)

Arguments

.data

An eeg_lst object.

.q

integer factor(s) to downsample by.

.max_sample

Optionally, the (approximated) maximum sample number can be defined here, which is at least half of the total number of samples

.n

Order of the filter used prior to the downsampling, specified as a positive integer. Default: 8 if ftype equals "iir"; 30 of ftype equals "fir".

.ftype

filter type; either "fir", specifying a FIR filter of length n designed with the function fir1, or "iir" (default), specifying an IIR Chebyshev filter of order 8 using the function cheby1.

.multiple_times

Indicates whether to factorize 'q“ and apply the downsampling in steps.

...

Not in use.

Details

A factor q larger than 13 can result in NAs. To avoid this, the downsampling can be done in steps. For example, instead of setting q = 20, it is possible to set q = c(2,10).

See Also

Other preprocessing functions: eeg_baseline(), eeg_ica_keep(), eeg_ica(), eeg_rereference(), eeg_segment(), filt

Other plotting functions: annotate_electrodes(), annotate_events(), annotate_head(), ggplot.eeg_lst(), plot.eeg_lst(), plot_components(), plot_in_layout(), plot_topo(), theme_eeguana()


bnicenboim/eeguana documentation built on March 16, 2024, 7:21 a.m.