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
ftypeequals"iir"; 30 offtypeequals"fir".- .ftype
filter type; either
"fir", specifying a FIR filter of lengthndesigned with the functionfir1, or"iir"(default), specifying an IIR Chebyshev filter of order 8 using the functioncheby1.- .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(),
eeg_ica_keep(),
eeg_rereference(),
eeg_segment(),
filt
Other plotting functions:
annotate_electrodes(),
annotate_events(),
annotate_head(),
eeg_browse(),
ggplot.eeg_lst(),
plot.eeg_lst(),
plot_components(),
plot_in_layout(),
plot_topo(),
theme_eeguana()
