Removes linear or polynomial trends from the signal.
Usage
detrendSignal(x, type = c("linear", "constant"), output_assay = "detrended")Value
A PhysioExperiment object with a new assay named output_assay
containing detrended data. For "constant" type, the channel mean is
subtracted. For "linear" type, a least-squares linear fit is removed.
See also
detrendSignals() for the alternative detrending implementation
with polynomial support, butterworthFilter() for highpass filtering
as an alternative to detrending.
Examples
pe <- PhysioExperiment(
assays = list(raw = matrix(rnorm(200 * 2) + seq_len(200) / 50,
nrow = 200, ncol = 2)),
samplingRate = 100
)
pe <- detrendSignal(pe, type = "linear")