22 #ifndef GAUSSFILTERTYPES_H 23 #define GAUSSFILTERTYPES_H 25 #include <boost/math/distributions/normal.hpp> 38 template <
typename TReal>
41 std::vector<TReal> & gauss,
46 ralab::base::base::seq<TReal>( -ceil(TReal(2*fwhm)), ceil(TReal(2*fwhm)) ,
x);
47 TReal sigma = fwhm/2.35;
57 template <
typename TReal>
60 std::vector<TReal> & gauss,
67 throw std::logic_error(
"quantile >= 0.5");
71 TReal sigma = fwhm/2.35;
72 boost::math::normal_distribution<TReal> nd_(0,sigma);
73 TReal quant = floor(boost::math::quantile(nd_,quantile));
86 template <
typename TReal>
88 std::vector<TReal> & gauss1d,
94 TReal sigma = fwhm/2.35;
101 template <
typename TReal>
103 std::vector<TReal> & gauss1d,
110 throw std::logic_error(
"quantile >= 0.5");
112 std::vector<TReal>
x;
113 TReal sigma = fwhm/2.35;
114 boost::math::normal_distribution<TReal> nd_(0,sigma);
115 TReal quant = floor(boost::math::quantile(nd_,quantile));
void seq(TReal from, TReal to, std::vector< TReal > &result)
generates the sequence from, from+/-1, ..., to (identical to from:to).
TReal getGaussianFilterQuantile(std::vector< TReal > &gauss, TReal fwhm=20, TReal quantile=0.01)
generate the gauss filter function for filtering of peaks with fwhm (full width at half max) ...
TReal getGaussian1DerWorker(TReal sigma, std::vector< TReal > &gauss1d, std::vector< TReal > &x)
TReal getGaussianFilter(std::vector< TReal > &gauss, TReal fwhm=20)
generate the gauss filter function for filtering of peaks with fwhm (full width at half max) ...
TReal getGaussWorker(TReal sigma, std::vector< TReal > &gauss, std::vector< TReal > &x)
EQUISPACEINTERPOL Interpolation on a equidistantly spaced grid.
TReal getGaussian1DerFilterQuantile(std::vector< TReal > &gauss1d, TReal fwhm=20, TReal quantile=0.1)
KernelTraitsBase< Kernel >::space_type::abscissa_type x
TReal getGaussian1DerFilter(std::vector< TReal > &gauss1d, TReal fwhm=20)
generate first derivative Gauss
void filter(const TContainer &data, const TContainer &filter, TContainer &result, bool circular=false, uint32_t sides=2)
Applies linear convolution (filtering) to a univariate time series.