Vespucci  1.0.0
Vespucci::Math::Smoothing Namespace Reference

Functions

VESPUCCI_EXPORT arma::mat SVDDenoise (const arma::mat &X, arma::uword k, arma::mat &U, arma::vec &s, arma::mat &V)
 
VESPUCCI_EXPORT arma::mat QUICSVDDenoise (const arma::mat &X, double epsilon, arma::mat &U, arma::vec &s, arma::mat &V, arma::uword &rank)
 
VESPUCCI_EXPORT arma::mat sgolay (arma::uword poly_order, arma::uword window_size, arma::uword deriv_order, arma::uword scaling_factor)
 Vespucci::Math::Smoothing::sgolay Find a arma::matrix of Savitzky-Golay convolution coefficients. More...
 
VESPUCCI_EXPORT arma::mat sgolayfilt (const arma::mat &x, arma::uword poly_order, arma::uword window_size, arma::uword deriv_order, arma::uword scaling_factor)
 sgolayfilt Apply Savitzky-Golay smoothing to each column of a arma::matrix More...
 
VESPUCCI_EXPORT arma::vec ApplyFilter (const arma::vec &x, arma::mat coefficients, arma::uword window_size)
 Vespucci::Math::Smoothing::ApplyFilter Apply FIR filters to a column vector. More...
 
VESPUCCI_EXPORT arma::vec ApplyFilter (const arma::vec &x, arma::vec filter)
 Vespucci::Math::Smoothing::ApplyFilter. More...
 
VESPUCCI_EXPORT arma::vec CreateMovingAverageFilter (arma::uword window_size)
 Vespucci::Math::Smoothing::CreateMovingAverageFilter. More...
 
VESPUCCI_EXPORT arma::vec MedianFilter (const arma::vec &X, arma::uword window_size)
 Vespucci::Math::Smoothing::MedianFilter. More...
 
VESPUCCI_EXPORT arma::mat MedianFilterMat (const arma::mat &X, arma::uword window_size)
 Vespucci::Math::Smoothing::MedianFilterMat. More...
 
VESPUCCI_EXPORT arma::vec WhittakerSmooth (const arma::vec &x, double lambda, arma::uword penalty_order)
 Vespucci::Math::WhittakerSmooth. More...
 
VESPUCCI_EXPORT arma::mat InterpolateToNewAbscissa (const arma::mat &spectra, const arma::vec &old_abscissa, const arma::vec &new_abscissa, const int window_size, const int order)
 InterpolateToNewAbscissa. More...
 
VESPUCCI_EXPORT arma::mat InterpolateToNewAbscissa (const arma::mat &spectra, const arma::vec &old_abscissa, const arma::vec &new_abscissa)
 InterpolateToNewAbscissa. More...
 

Function Documentation

arma::vec Vespucci::Math::Smoothing::ApplyFilter ( const arma::vec &  x,
arma::mat  coefficients,
arma::uword  window_size 
)

Vespucci::Math::Smoothing::ApplyFilter Apply FIR filters to a column vector.

Parameters
xData to be filtered
coefficientsA arma::matrix of FIR filters.
window_sizeFilter window size
Returns
Filtered data Apply FIR filters to a column vector. The central row of coefficients contains the filter used for most of the data. The first (window_size - 1)/2 rows are filtered with the lower rows ofccoefficients, and likewise for the last (window_size - 1)/2 rows and the first rows of coefficients.

Definition at line 126 of file FIR.cpp.

arma::vec Vespucci::Math::Smoothing::ApplyFilter ( const arma::vec &  x,
arma::vec  filter 
)

Vespucci::Math::Smoothing::ApplyFilter.

Parameters
xThe vector to filter
filterThe filter
Returns
Filtered data Applies an FIR filter to x

Definition at line 145 of file FIR.cpp.

arma::vec Vespucci::Math::Smoothing::CreateMovingAverageFilter ( arma::uword  window_size)

Vespucci::Math::Smoothing::CreateMovingAverageFilter.

Parameters
window_sizeThe window size of the filter.
Returns
A moving average filter Create a moving average filter of a certain window size.

Definition at line 160 of file FIR.cpp.

arma::mat Vespucci::Math::Smoothing::InterpolateToNewAbscissa ( const arma::mat &  spectra,
const arma::vec &  old_abscissa,
const arma::vec &  new_abscissa,
const int  window_size,
const int  order 
)

InterpolateToNewAbscissa.

Parameters
spectra
old_abscissa
new_abscissa
window_size
order
Returns

Definition at line 177 of file FIR.cpp.

arma::mat Vespucci::Math::Smoothing::InterpolateToNewAbscissa ( const arma::mat &  spectra,
const arma::vec &  old_abscissa,
const arma::vec &  new_abscissa 
)

InterpolateToNewAbscissa.

Parameters
spectra
new_abscissa
Returns
Performs linear interpolation using the two closest points. Is faster than the spline method

Definition at line 211 of file FIR.cpp.

arma::vec Vespucci::Math::Smoothing::MedianFilter ( const arma::vec &  X,
arma::uword  window_size 
)

Vespucci::Math::Smoothing::MedianFilter.

Parameters
X
window_size
Returns
Performs median filtering on a signal X. This just ignores the edges becuause they will be fairly small and not very interesting.

Definition at line 30 of file nonlinear.cpp.

arma::mat Vespucci::Math::Smoothing::MedianFilterMat ( const arma::mat &  X,
arma::uword  window_size 
)

Vespucci::Math::Smoothing::MedianFilterMat.

Parameters
X
window_size
Returns
Performs Median Filter over a arma::matrix with spectra in columns

Definition at line 61 of file nonlinear.cpp.

arma::mat Vespucci::Math::Smoothing::QUICSVDDenoise ( const arma::mat &  X,
double  epsilon,
arma::mat &  U,
arma::vec &  s,
arma::mat &  V,
arma::uword &  rank 
)

Definition at line 28 of file denoise.cpp.

arma::mat Vespucci::Math::Smoothing::sgolay ( arma::uword  poly_order,
arma::uword  window_size,
arma::uword  deriv_order,
arma::uword  scaling_factor 
)

Vespucci::Math::Smoothing::sgolay Find a arma::matrix of Savitzky-Golay convolution coefficients.

Parameters
poly_order
window_size
deriv_order
scaling_factor
Returns
A arma::matrix of size window_size by window_size containing coefficients. Finds a arma::matrix of Savitzky-Golay convolution coefficients, similar to the sgolay function in the Octave and arma::matLAB signal packages. The central row is the filter used for most of the dataset. The outer rows are used on the edges of the signal to be filtered.

Definition at line 36 of file FIR.cpp.

arma::mat Vespucci::Math::Smoothing::sgolayfilt ( const arma::mat &  x,
arma::uword  poly_order,
arma::uword  window_size,
arma::uword  deriv_order,
arma::uword  scaling_factor 
)

sgolayfilt Apply Savitzky-Golay smoothing to each column of a arma::matrix

Parameters
xInput arma::matrix. Each column is a signal
poly_orderPolynomial order for smoothing
window_sizeSize of filter window. Must be odd and larger than poly order
deriv_orderDerivative order, to extract derivatized data directly
scaling_factorA scaling factor
Returns
Smoothed data

Definition at line 89 of file FIR.cpp.

arma::mat Vespucci::Math::Smoothing::SVDDenoise ( const arma::mat &  X,
arma::uword  k,
arma::mat &  U,
arma::vec &  s,
arma::mat &  V 
)

Definition at line 22 of file denoise.cpp.

arma::vec Vespucci::Math::Smoothing::WhittakerSmooth ( const arma::vec &  x,
double  lambda,
arma::uword  penalty_order 
)

Vespucci::Math::WhittakerSmooth.

Parameters
x
lambda
penalty_order
Returns
This may be re-written to use a sparse Cholesky decomposition if such a function comes to exist in armadillo or MLPACK

Definition at line 31 of file whittaker.cpp.