cprep | R Documentation |
PREP pipeline for continuous data
cprep(
x,
fs = 1,
dtsens = setdiff(colnames(x), "t"),
detrend = c("highpass", "linear", "mean", "constant", "none"),
hpcf = 1,
hptbw = 1,
hpdev = 0.01,
lnsens = dtsens,
lfreq = 50,
fbw = 2,
w = 4,
overlap = 0,
tbw = 2,
k = round(tbw * w - 1),
p = 0.01,
tau = 100,
MaxIterLn = 10,
rrsens = lnsens,
oldref = NULL,
newref = "robust",
saveref = FALSE,
interp = c("post-reference", "pre-reference", "none"),
estmean = c("median", "huber", "mean"),
sl = getLocationsfromLabels(colnames(x[, rrsens])),
MaxIterRR = 4,
report = paste(getwd(), "cprep_report.pdf", sep = "/")
)
x |
input time series, specified as a numeric matrix or vector. In case
of a vector it represents a single signal; in case of a matrix each column
is a signal. Alternatively, an object of class |
fs |
sampling frequency of |
dtsens |
sensors to detrend, specified as positive integers indicating
sensors numbers, or as sensor names (colnames of |
detrend |
character string indicating which type of trend removal is performed for line noise removal bad channel detection; one of:
|
hpcf |
high-pass cutoff frequency in Hz, specified as a positive numeric value. Default: 1 Hz |
hptbw |
high-pass transition bandwith in Hz, specified as a positive numeric value. For instance, if the high-pass cutoff frequency is 1 Hz, and the transition bandwith is also 1 Hz, the transition band of 1 Hz is located between 0.5 and 1.5 Hz. Default: 1 Hz. |
hpdev |
deviation from desired stop- and passband of the high-pass filter, specified as a positive numeric value. Default: 0.01 |
lnsens |
sensors to remove line noise from, specified as positive
integers indicating sensors numbers, or as sensor names (colnames of
|
lfreq |
line frequencies to remove, either specified as a single numeric value, or as a character string. If a single numeric value is specified, then this value will be expanded to include multiples of that frequency (harmonics) up to the Nyquist frequency. If a character string is specified, then the string will be converted to numeric values without further expansion. Default: 50 |
fbw |
frequency bandwidth. Bandwidth centered on each |
w |
length of sliding window (segments) in seconds. Default: 4 |
overlap |
proportion of overlap between the segments. Default: 0 |
tbw |
taper bandwidth, specified as a positive numeric value. Default: 2 Hz |
k |
number of tapers to use, specified as a positive numeric value.
Default: |
p |
significance level cutoff for F-test. Default 0.01 |
tau |
Window overlap smoothing factor. Default: 100 |
MaxIterLn |
Maximum times to iterate line noise removal. Default: 10 |
rrsens |
vector of sensor names or numbers that are used for the referencing (hence they must contain EEG data). Default: lnsens. |
oldref |
vector of sensor names or numbers that formed the original
reference. If specified, the old reference signal is reconstructed back
into the data object (added if it was not present in the data). Ignored if
|
newref |
signals that form the new reference, either specified as a
character vector of signal names ( |
saveref |
logical indication whether to save to new reference as a |
interp |
For |
estmean |
For |
sl |
For |
MaxIterRR |
maximum number of iterations used for detecting noisy
channels and recomputing the reference. Default: 4. Only used in case
|
report |
name of PDF file to which a detailed processing report is printed, or NULL to suppress the report. Default: "cprep_report.pdf", saved to the current working directory |
A list consisting of the following elements:
a ctd
object containing the robust referenced data
list containing the output from running
noisysensors
on the input data
list containing the output from running
noisysensors
on the output data
Original Matlab code by Tim Mullen (2011); ported to R and adapted by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com,
detrend
, removetrend
cleanline
, link{noisysensors}
,
reref
## Not run:
rr <- cprep(EEGdata[, 1:29], fs = fs(EEGdata))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.