Emscorr: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Neal
No edit summary
imported>Neal
Line 46: Line 46:


===Algorithm===
===Algorithm===
In EMSC, a ''N''x1 signal vector <math>{\mathbf{x}}</math> is modeled as
:<math>{\mathbf{x}} = \left[ {\begin{array}{*{20}c}
  {{\mathbf{x}}_{ref} } & {\mathbf{V}} & {\mathbf{S}} & {\mathbf{P}}  \\
\end{array} } \right] {\mathbf{c}}</math>
where <math>{\mathbf{x}_{ref}}</math> is a ''N''x1 reference vector, and <math>{\mathbf{V}}</math> is a ''N''x<math>{\mathit{K}_{v}}</math> matrix consisting of polynomials of the axis scale. For example, if the axis scale is in wavenumbers <math>{\nu}</math> then
:<math>{\mathbf{V}} = \left[ {\begin{array}{*{20}c}
  {\mathbf{1}} & {\mathbf{\nu }} & {{\mathbf{\nu }}^2 } &  \ldots  \\
\end{array} } \right]</math> .
The ''N''x<math>{\mathit{K}_{s}}</math> matrix <math>{\mathbf{S}}</math> corresponds to signal allowed to pass the filter and the ''N''x<math>{\mathit{K}_{p}}</math> matrix <math>{\mathbf{P}}</math> corresponds to signal filtered out of the signal. Typically, <math>{\mathbf{S}}</math> will correspond to spectra of target signal and <math>{\mathbf{P}}</math> will correspond to basis vectors that capture clutter signal (e.g., loadings from PCA of clutter). The vector <math>{{\mathbf{c}}^T = \mathit{c}_{ref}+{\mathbf{c}_{v}^{T}}+{\mathbf{c}_{s}^{T}}+{\mathbf{c}_{p}^{T}} }</math> contains corresponding coefficients to be estimated using least squares. The estimated coefficients and the basis vectors are used to "correct" the signal using the following
:<math>{\mathbf{x}_{corrected}} = {({\mathbf{x}} - {\mathbf{V}}{\mathbf{c}_{v}} - {\mathbf{P}}{\mathbf{c}_{p}})} / \mathit{c}_{ref} </math>  .


===Example===
===Example===

Revision as of 13:23, 16 October 2008

Purpose

Extended multiplicative scatter correction (EMSC) preprocessing.

Synopsis

[sx,fx,xref,reg,res] = emscorr(x,xref,options)

Description

EMSCORR attempts to remove additive and multiplicative scattering effects in spectra. This can be thought of as a filter where some portions of the signal are passed and some are rejected. Each row of input (x) is regressed against input (xref) and the results are used to "correct" (x). If (xref) is not input then mean(x) is used.

There are several options to allow for weighted least squares (i.e., to de-weight channels that should not be included in the regression), for using different spectra to be filtered out, and for using spectra not to filtered out.

Inputs

x = is a MxN matrix (class "double") of M spectra measured at N channels.

Optional Inputs

xref = 1xN reference spectrum to regress against. If not input, mean(x) is used.
options = structure array with the following fields:
order: [ {2} ] Order of the polynomial filter (positive integer).
logax: [ {'no'} | 'yes' ] Use the log of the axisscale, x.axisscale{2} as a basis vector to regress against. If the axisscale is not present log(1:N) is used. When (options.logax) is used, (options.order) is typically set to zero.
s: [ ] KxN spectra to not filter out.
p: [ ] KpxN spectra to filter out.
algorithm: [ {'cls'} | 'ils' ] Governs correction model method.
'cls' uses Classical Least Squares i.e., EMSC.
'ils' uses Inverse Least Squares i.e., EISC.
win: [ ] An odd scalar that defines the window width (number of variables) for piece-wise correction. If empty {the default} piece-wise is not used. Note that piece-wise correction can be slow.
initwt: [ ] Empty or Nx1 vector of initial weights (0<=w<=1). Low weights are used for channels not to be included in the fit.
condnum: [1e6] Maximum condition number for Z'*Z' used in the least squares estimates (see Algorithm).
xrefS: [{'no'} | 'yes'] Indicates whether input (xref) includes spectra contained in (options.s). If 'yes' then the spectra in (options.s) are centered and an SVD estimate of (options.s) is used in EMSCORR instead of (options.s).
robust: [ {'none'} | 'lsq2top' ] Governs the use of robust least squares. If 'lsq2top' is used then (options.trbflag), (options.tsqlim) and (options.stopcrit) are also used (see LSQ2TOP for descriptions of these fields).
res: [ ] Positive scalar (required with options.lsq2top = 'yes'). It is the input (res) to the LSQ2TOP function.
trbflag: [ 'top' | 'bottom' | {'middle'} ] Used only when options.lsq2top = 'yes'.
tsqlim: [ 0.99 ] Used only when options.lsq2top = 'yes'.
stopcrit: [1e-4 1e-4 1000 360] Used only when options.lsq2top = 'yes'.
axisscale: [ ] 1xN axis scale for the spectral mode, if empty [1:N] is used.
mag: [ {'yes'} | 'no' ], performs slope correction when set to 'yes'.

Outputs

sx = the corrected spectra.
fx = the signal that was filtered out.
xref = the reference spectrum.
reg = the regression coefficients. For non-windowed filtering, (reg) is [number of coefficients] x M. The number of coefficients corresponds to the number of basis vectors included in the correction. The coefficients are ordered according to the following: xbase = [xref, 1 x x2 ..., options.p, options.s]. If a windowed filter is used, (reg) is [number of coefficients] x N x M where mode 2 corresponds to the windows.
res = MxN matrix of residuals.

Algorithm

In EMSC, a Nx1 signal vector is modeled as

where is a Nx1 reference vector, and is a Nx matrix consisting of polynomials of the axis scale. For example, if the axis scale is in wavenumbers then

.

The Nx matrix corresponds to signal allowed to pass the filter and the Nx matrix corresponds to signal filtered out of the signal. Typically, will correspond to spectra of target signal and will correspond to basis vectors that capture clutter signal (e.g., loadings from PCA of clutter). The vector contains corresponding coefficients to be estimated using least squares. The estimated coefficients and the basis vectors are used to "correct" the signal using the following

.

Example

>>This is an example
Error: does not exist

See Also

mscorr, stdfir, emscorrdemo2