detrend_ETG4000_data: Detrend the ETG-4000 data.

Description Usage Arguments Value Examples

Description

Removes a linear trend.

Usage

1
detrend_ETG4000_data(x, type = "all", channel = NULL)

Arguments

x

A data frame with an ETG-4000 data.

type

A string. Specifies the type of plot. Allowed: "all" or "single".

channel

A numeric or string. If type is "single" then it has to be specified.

Value

A data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
file_path <- system.file("extdata", "Hitachi_ETG4000_24Ch_Total.csv", package = "fnirsr")
ETG_header <- load_ETG4000_header(file_path)

fnirs_signal <- load_ETG4000_data(file_path, ETG_header)
plot_ETG4000(fnirs_signal)
fnirs_det <- detrend_ETG4000_data(fnirs_signal) # detrend all channels
plot_ETG4000(fnirs_det)

plot_ETG4000(fnirs_signal, "separate", 18) # zoom on one channel to notice detrending
plot_ETG4000(fnirs_det, "separate", 18)

fnirs_det_24 <- detrend_ETG4000_data(fnirs_signal, "single", 24) # detrend only one channel
plot_ETG4000(fnirs_det_24, "separate", 24)

erzk/fnirsr documentation built on May 16, 2019, 8:50 a.m.