prospectr (version 0.1.3)

standardNormalVariate: Standard normal variate transformation

Description

standardNormalVariate normalizes each row of an input data.frame or matrix by substracting each row by its mean and dividing by its standard deviation

Usage

standardNormalVariate(X)

Arguments

X
numeric data.frame or matrix to transform

Value

  • a matrix of the transformed data

Details

SNV is simple way for normalizing spectral data that intends to correct for light scatter. It operates row-wise: $$SNV_i = \frac{x_i - \bar{x_i}}{s_i}$$ where $x_i$ is the signal of a sample $i$, $\bar{x_i}$ is its mean and $s_i$ its standard deviation

References

Barnes RJ, Dhanoa MS, Lister SJ. 1989. Standard normal variate transformation and de-trending of near-infrared diffuse reflectance spectra. Applied spectroscopy, 43(5): 772-777.

See Also

detrend, blockScale, blockNorm, msc

Examples

Run this code
data(NIRsoil)
spc <- 1/10^NIRsoil$spc # conversion to reflectance
snv <- standardNormalVariate(X = spc)
# 10 first snv spectra
matplot(as.numeric(colnames(snv)),t(snv[1:10,]),type='l',xlab='wavelength /nm',ylab='snv')
apply(snv,1,sd) # check

Run the code above in your browser using DataLab