whitening {biosignalEMG}R Documentation

Decorrelates an EMG signal


Decorrelates an EMG signal using an SVD decomposition of a covariance matrix.


whitening(data, channel, method = c("PCA", "ZCA"), k = 4, r = 1, data.name)



an ‘emg’ object.


in case of multi-channel data, channel is the specific channel to be considered by the procedure. Possible values: a character vector specifying the name of the channel to be considered (case sensitive) or a numeric value specifying the channel to be considered (number of column in data).


the whitening method to be applied to the EMG signal: "PCA" (default) or "ZCA" (see ‘References’).


number of columns (see ‘Details’) to construct the covariance matrix.


column to be used as the whitened signal (see ‘Details’).


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 data.


Whitening an EMG signal is a preprocessing step that can improve amplitude estimation, onset activation detection and fecature classification.

A whitening transformation reduces autocorrelation within a signal.

The implemented methods are PCA and ZCA, both based on a SVD decomposition of a covariance matrix. The (artificial) matrix is constructed with k shifted versions of the EMG signal. The result is then an matrix with k columns. The output of the whitening procedure is (usually) the first column (r=1).


An ‘emg’ object storing the whitened EMG.


The output is not fully whitened. The method decorrelates the columns of the artificial matrix, which contains a shifted version of the signal. At the end only one column (which can be autocorrelated) is taken as the output. Also, it works better when the sampling rate is high (low sampling rates tend to produce decorrelated samples).


J.A. Guerrero jaguerrero@correo.uaa.mx


Implementing PCA/Whitening http://ufldl.stanford.edu/wiki/index.php/Implementing_PCA/Whitening

See Also

dcbiasremoval, highpass


# Load a data.frame with EMG data
# Coerce a data.frame into an 'emg' object
x <- as.emg(emg95306000, samplingrate = 1000, units = "mV")

# Whitening x
y <- whitening(x)

# change graphical parameters to show multiple plots
op <- par(mfrow = c(2, 1))

# plot the original channel and the corresponding whitened channel
plot(x, main = "Original  channel")
plot(y, main = "Whitened channel")

# reset graphical parameters

[Package biosignalEMG version 2.1.0 Index]