#include <SavitzkyGolaySmoother.hpp>
|
| 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 std::vector< T > | smooth_copy (const std::vector< T > &data) |
|
|
boost::shared_ptr< Impl > | impl_ |
|
template<typename T>
struct pwiz::analysis::SavitzkyGolaySmoother< T >
Definition at line 37 of file SavitzkyGolaySmoother.hpp.
◆ SavitzkyGolaySmoother()
◆ ~SavitzkyGolaySmoother()
◆ smooth_copy() [1/2]
Definition at line 40 of file SavitzkyGolaySmoother.hpp.
41 {
42 if (data.size() < 9)
43 return data;
44 typename std::vector<T>::const_iterator start;
45 typename std::vector<T> smoothedData(data.begin(), data.begin()+4);
46 for (start = data.begin();
47 (start+8) != data.end();
48 ++start)
49 {
50 T sum = 59 * *(start+4) + 54 * (*(start+3) + *(start+5)) +
51 39 * (*(start+2) + *(start+6)) + 14 * (*(start+1) + *(start+7)) -
52 21 * (*start + *(start+8));
53 smoothedData.push_back(sum / 231);
54 }
55 smoothedData.insert(smoothedData.end(), data.end()-4, data.end());
56 return smoothedData;
57 }
Referenced by test().
◆ smooth()
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.
Referenced by test().
◆ smooth_copy() [2/2]
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.
◆ impl_
The documentation for this struct was generated from the following files: