#include <SavitzkyGolaySmoother.hpp>
List of all members.
Public Member Functions |
| SavitzkyGolaySmoother (int polynomialOrder, int windowSize) |
| ~SavitzkyGolaySmoother () |
virtual void | smooth (const std::vector< double > &x, const std::vector< double > &y, std::vector< double > &xSmoothed, std::vector< double > &ySmoothed) |
| smooth y values to existing vectors using Savitzky-Golay algorithm; preconditions:
|
virtual void | smooth_copy (std::vector< double > &x, std::vector< double > &y) |
| smooth y values and copy back to the input vectors using Savitzky-Golay algorithm; preconditions:
|
virtual | ~Smoother () |
Static Public Member Functions |
static std::vector< T > | smooth_copy (const std::vector< T > &data) |
Private Attributes |
boost::shared_ptr< Impl > | impl_ |
Detailed Description
template<typename T>
struct pwiz::analysis::SavitzkyGolaySmoother< T >
Definition at line 37 of file SavitzkyGolaySmoother.hpp.
Constructor & Destructor Documentation
Member Function Documentation
Definition at line 40 of file SavitzkyGolaySmoother.hpp.
{
if (data.size() < 9)
return data;
typename std::vector<T>::const_iterator start;
typename std::vector<T> smoothedData(data.begin(), data.begin()+4);
for (start = data.begin();
(start+8) != data.end();
++start)
{
T sum = 59 * *(start+4) + 54 * (*(start+3) + *(start+5)) +
39 * (*(start+2) + *(start+6)) + 14 * (*(start+1) + *(start+7)) -
21 * (*start + *(start+8));
smoothedData.push_back(sum / 231);
}
smoothedData.insert(smoothedData.end(), data.end()-4, data.end());
return smoothedData;
}
template<typename T >
virtual void pwiz::analysis::SavitzkyGolaySmoother< T >::smooth |
( |
const std::vector< double > & |
x, |
|
|
const std::vector< double > & |
y, |
|
|
std::vector< double > & |
xSmoothed, |
|
|
std::vector< double > & |
ySmoothed |
|
) |
| |
|
virtual |
smooth y values to existing vectors using Savitzky-Golay algorithm; preconditions:
- samples within the window must be (approximately) equally spaced
Implements pwiz::analysis::Smoother.
smooth y values and copy back to the input vectors using Savitzky-Golay algorithm; preconditions:
- samples within the window must be (approximately) equally spaced
Implements pwiz::analysis::Smoother.
Member Data Documentation
The documentation for this struct was generated from the following files: