powered by
'Detrending' is often used before the signal power calculation.
detrend(x, trend = c("constant", "linear"), break_points = NULL)
The signals with trend removed in matrix form; the number of columns is the number of signals, and number of rows is length of the signals
numerical or complex, a vector or a matrix
the trend of the signal; choices are 'constant' and 'linear'
'constant'
'linear'
integer vector, or NULL; only used when trend is 'linear' to remove piecewise linear trend; will throw warnings if trend is 'constant'
NULL
trend
x <- rnorm(100, mean = 1) + c( seq(0, 5, length.out = 50), seq(5, 3, length.out = 50)) plot(x) plot(detrend(x, 'constant')) plot(detrend(x, 'linear')) plot(detrend(x, 'linear', 50))
Run the code above in your browser using DataLab