There are other posts in this blog about SNV (standard normal variate), and we can combine them to get the SNV + Detrend math treatment.
First let´s apply the SNV:
yarn_snv<-scale(t(yarn$NIR),center=TRUE,scale=TRUE)
wavelengths1<-seq(1,268,by=1) #para "yarn"
matplot(wavelengths1,yarn_snv,type="l",main="Yarn spectra with +SNV",xlab="Wavelength (nm)",ylab="1/R (log 1/R)",lty=1,col=1)
and now the Detrend:
library(pracma)yarndt_NIR<-detrend(t(yarn$NIR),tt="linear")
matplot(wavelengths1,yarndt_NIR,type="l",lty=1,xlab="Wavelength
+(nm)",ylab="1/R")
No hay comentarios:
Publicar un comentario