Learn R Programming

biosignalEMG (version 2.0.0)

whitening: Decorrelates an EMG signal

Description

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

Usage

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

Arguments

data
an ‘emg’ object.
channel
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).
method
the whitening method to be applied to the EMG signal: "PCA" (default) or "ZCA" (see ‘References’).
k
number of columns (see ‘Details’) to construct the covariance matrix.
r
column to be used as the whitened signal (see ‘Details’).
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 data.

Value

An ‘emg’ object storing the whitened EMG.

Details

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

References

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

See Also

dcbiasremoval, highpass

Examples

Run this code
# Load a data.frame with EMG data
data(emg95306000)
# 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
par(op)

Run the code above in your browser using DataLab