Mscorr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Jeremy
(Importing text file)
Line 1: Line 1:
===Purpose===
===Purpose===
Multiplicative scatter/signal correction (MSC).
Multiplicative scatter/signal correction (MSC).
===Synopsis===
===Synopsis===
:[sx,alpha,beta,xref] = mscorr(x,xref,mc,win,specmode,subind)
:[sx,alpha,beta,xref] = mscorr(x,xref,mc,win,specmode,subind)
===Description===
===Description===
MSCORR performs multiplicative scatter correction (a.k.a. multiplicative signal correction) on an input matrix of spectra x (class "double") regressed against a reference spectra xref (class "double"). If (xref) is empty or omitted, the mean of (x) is used as the reference.
MSCORR performs multiplicative scatter correction (a.k.a. multiplicative signal correction) on an input matrix of spectra x (class "double") regressed against a reference spectra xref (class "double"). If (xref) is empty or omitted, the mean of (x) is used as the reference.
If the optional input ''mc'' is 1 {default} then an intercept is used. If ''mc'' is set to 0 (zero) then a force fit through zero is used.
If the optional input ''mc'' is 1 {default} then an intercept is used. If ''mc'' is set to 0 (zero) then a force fit through zero is used.
Optional input ''win'' is a ''NK'' element cell array of indices corresponding to windows to perform MSC, i.e. MSC is performed in each window win{i} for ''i=1:NK''. In this case, (alpha and beta are not assigned). Optional input (specmode) defines which mode of the data is the spectral mode (default = 2) and is only used when (x) contains 3 or more modes. Optional input (subind) specifies the indices within the included spectral variables that are used to calculate the MSC correction factors (alpha and beta); default is that ALL included spectral variables are used.
Optional input ''win'' is a ''NK'' element cell array of indices corresponding to windows to perform MSC, i.e. MSC is performed in each window win{i} for ''i=1:NK''. In this case, (alpha and beta are not assigned). Optional input (specmode) defines which mode of the data is the spectral mode (default = 2) and is only used when (x) contains 3 or more modes. Optional input (subind) specifies the indices within the included spectral variables that are used to calculate the MSC correction factors (alpha and beta); default is that ALL included spectral variables are used.
Outputs are the corrected spectra sx, the intercepts/offsets alpha, the multiplicative scatter factor/slope beta, and the reference spectrum xref.
Outputs are the corrected spectra sx, the intercepts/offsets alpha, the multiplicative scatter factor/slope beta, and the reference spectrum xref.
===Algorithm===
===Algorithm===
For input spectra '''x''' (1x''N'') and reference spectra '''x'''<sub>ref</sub> (1x''N'') the model is:
For input spectra '''x''' (1x''N'') and reference spectra '''x'''<sub>ref</sub> (1x''N'') the model is:
  '''x'''<sup>T</sup>? + ? = '''x'''<sup>T</sup><sub>ref</sub> .
  '''x'''<sup>T</sup>? + ? = '''x'''<sup>T</sup><sub>ref</sub> .
and the corrected spectra '''x'''<sub>s</sub> (1x''N'') is given by:
and the corrected spectra '''x'''<sub>s</sub> (1x''N'') is given by:
  '''x'''<sub>s</sub> = ('''x'''<sub>ref</sub> -?)/? .
  '''x'''<sub>s</sub> = ('''x'''<sub>ref</sub> -?)/? .
===See Also===
===See Also===
[[frpcr]], [[stdfir]], [[stdgen]]
[[frpcr]], [[stdfir]], [[stdgen]]

Revision as of 15:25, 3 September 2008

Purpose

Multiplicative scatter/signal correction (MSC).

Synopsis

[sx,alpha,beta,xref] = mscorr(x,xref,mc,win,specmode,subind)

Description

MSCORR performs multiplicative scatter correction (a.k.a. multiplicative signal correction) on an input matrix of spectra x (class "double") regressed against a reference spectra xref (class "double"). If (xref) is empty or omitted, the mean of (x) is used as the reference.

If the optional input mc is 1 {default} then an intercept is used. If mc is set to 0 (zero) then a force fit through zero is used.

Optional input win is a NK element cell array of indices corresponding to windows to perform MSC, i.e. MSC is performed in each window win{i} for i=1:NK. In this case, (alpha and beta are not assigned). Optional input (specmode) defines which mode of the data is the spectral mode (default = 2) and is only used when (x) contains 3 or more modes. Optional input (subind) specifies the indices within the included spectral variables that are used to calculate the MSC correction factors (alpha and beta); default is that ALL included spectral variables are used.

Outputs are the corrected spectra sx, the intercepts/offsets alpha, the multiplicative scatter factor/slope beta, and the reference spectrum xref.

Algorithm

For input spectra x (1xN) and reference spectra xref (1xN) the model is:

xT? + ? = xTref .

and the corrected spectra xs (1xN) is given by:

xs = (xref -?)/? .

See Also

frpcr, stdfir, stdgen