![]() |
sablib
|
Smoothing using simple/weighted moving average. More...
Go to the source code of this file.
Functions | |
| const std::vector< double > | sablib::WeightedMovingAverage (const std::vector< double > &y, const std::vector< double > &w) |
| Calculates the weighted moving average of the input signal (std::vector<double> version). | |
| template<typename Derived> | |
| const Derived::PlainObject | sablib::WeightedMovingAverage (const Eigen::MatrixBase< Derived > &y, const Eigen::MatrixBase< Derived > &w) |
| Calculates the weighted moving average of the input signal. | |
| const std::vector< double > | sablib::MovingAverage (const std::vector< double > &y, const unsigned int n) |
| Calculates the simple moving average of the input signal (std::vector<double> version). | |
| template<typename Derived> | |
| const Derived::PlainObject | sablib::MovingAverage (const Eigen::MatrixBase< Derived > &y, const unsigned int n) |
| Calculates the simple moving average of the input signal. | |
| const std::vector< double > | sablib::GaussianKernel (const unsigned int n, const double sigma) |
| Generates a Gaussian kernel. | |
| const std::vector< double > | sablib::GaussianFilter (const std::vector< double > &y, const unsigned int n, const double sigma) |
| Performs Gaussian smoothing on the input signal. | |
Smoothing using simple/weighted moving average.
Definition in file moving_average.h.
|
inline |
Performs Gaussian smoothing on the input signal.
This is a convenience function that generates a Gaussian kernel and then applies it using WeightedMovingAverage.
| y | The data to be smoothed. |
| n | Half-width of the Gaussian window (total size is 2 * n + 1). |
| sigma | The standard deviation of the Gaussian distribution. |
Definition at line 122 of file moving_average.h.
| const std::vector< double > sablib::GaussianKernel | ( | const unsigned int | n, |
| const double | sigma ) |
Generates a Gaussian kernel.
| n | Half-width of the Gaussian window (total size is 2 * n + 1). |
| sigma | The standard deviation of the Gaussian distribution. |
| std::invalid_argument | If n is zero or sigma is non-positive. |
Definition at line 46 of file moving_average.cpp.
| const Derived::PlainObject sablib::MovingAverage | ( | const Eigen::MatrixBase< Derived > & | y, |
| const unsigned int | n ) |
Calculates the simple moving average of the input signal.
| y | The data to be averaged. |
| n | Half-width of the moving average window (calculated using 2 * n + 1 points). |
| std::invalid_argument | If n is zero. |
Definition at line 87 of file moving_average.h.
| const std::vector< double > sablib::MovingAverage | ( | const std::vector< double > & | y, |
| const unsigned int | n ) |
Calculates the simple moving average of the input signal (std::vector<double> version).
| y | The data to be averaged. |
| n | Half-width of the moving average window (calculated using 2 * n + 1 points). |
Definition at line 15 of file moving_average.cpp.
| const Derived::PlainObject sablib::WeightedMovingAverage | ( | const Eigen::MatrixBase< Derived > & | y, |
| const Eigen::MatrixBase< Derived > & | w ) |
Calculates the weighted moving average of the input signal.
| y | The data to be averaged. |
| w | Weights. |
| std::invalid_argument | If the length of y or w is zero. |
Definition at line 36 of file moving_average.h.
| const std::vector< double > sablib::WeightedMovingAverage | ( | const std::vector< double > & | y, |
| const std::vector< double > & | w ) |
Calculates the weighted moving average of the input signal (std::vector<double> version).
| y | The data to be averaged. |
| w | Weights. |
Definition at line 30 of file moving_average.cpp.