Description Usage Arguments Value Author(s) See Also Examples
View source: R/dcbiasremoval.R
Adds a constant to all samples in the EMG to move the baseline noise mean in the presence of DC-offset or DC-bias.
1 | dcbiasremoval(data, channel, baseline, data.name)
|
data |
an ‘emg’ object. |
channel |
in case of multi-channel data, |
baseline |
constant to be substracted to the EMG signal. If not provided, this values is set so the resulting EMG has and overall mean of 0. |
data.name |
a string specifying the name of the variable which will appears on the plots. If empty or not provided is taken from the object given as |
An ‘emg’ object.
J.A. Guerrero jaguerrero@correo.uaa.mx
See also emg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # change graphical parameters to show multiple plots
op <- par(mfrow = c(2, 1))
# Creates a random vector to simulate a baseline noise with a DC-offset
x <- rnorm(1000, 1, 1)
emg1 <- emg(x, samplingrate = 1000, units = "mV", data.name = "")
plot(emg1, main = "Simulated EMG with a DC-offset")
abline(h = mean(emg1$values), col = "red", lwd = 2) # Show the position of the overall mean
# Remove the baseline noise mean
emg2 <- dcbiasremoval(emg1)
plot(emg2, main = "Simulated EMG with an overall zero mean")
abline(h = mean(emg2$values), col = "red", lwd = 2) # Show the position of the overall mean
# reset graphical parameters
par(op)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.