removetrend | R Documentation |
Perform detrending or high pass filtering to remove low frequencies
removetrend(
x,
fs = 1,
type = c("highpass", "linear", "mean", "constant", "none"),
hpcf = 1,
hptbw = 1,
hpdev = 0.01
)
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 |
type |
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 |
When high-pass filtering is requested, an optimal-length FIR filter is designed, which has a linear phase. The filger delay is corrected for by the function. Before filtering, reflected parts of the input data (equal to the calculated filter length) are added to the beginning and end of the data to avoid filter edge effects.
a list containing consisting of:
y
the detrended data
h
the filter coefficients
mean|constant
remove mean
none
no detrending
Geert van Boxtel, G.J.M.vanBoxtel@gmail.com
data(EEGdata)
det <- removetrend(EEGdata, hpcf = 1, hptbw = 1, hpdev = 0.01)
plot(det$y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.