sablib
Loading...
Searching...
No Matches
moving_median.cpp File Reference

Smoothing using moving median(implementation). More...

#include <algorithm>
#include <set>
#include "moving_median.h"

Go to the source code of this file.

Functions

const std::vector< double > sablib::MovingMedian (const std::vector< double > &y, const unsigned int n)
 Performs moving median smoothing.

Detailed Description

Smoothing using moving median(implementation).

Author
Izadori

Definition in file moving_median.cpp.

Function Documentation

◆ MovingMedian()

const std::vector< double > sablib::MovingMedian ( const std::vector< double > & y,
const unsigned int n )

Performs moving median smoothing.

Parameters
yThe input data vector (signal to be smoothed).
nHalf-width of the moving median window (calculated using 2 * n + 1 points).
Returns
The data after applying the moving median.
Exceptions
std::invalid_argumentIf the size of y or n is zero.

Definition at line 88 of file moving_median.cpp.