26 #include <edsp/meta/iterator.hpp> 30 namespace edsp {
namespace statistics {
47 template <
typename InputIt>
48 constexpr meta::value_type_t<InputIt>
norm(InputIt first, InputIt last) {
49 using value_type = meta::value_type_t<InputIt>;
50 const auto predicate = [](
const value_type accumulated,
const value_type comming) {
53 const auto accumulated = std::accumulate(first, last, static_cast<value_type>(0), std::cref(predicate));
54 return std::sqrt(accumulated);
59 #endif //EDSP_NORM_HPP constexpr meta::value_type_t< InputIt > norm(InputIt first, InputIt last)
Compute the L2-norm of the signals in the range [first1, last1).
Definition: norm.hpp:48
constexpr T square(T x)
Computes the square value of the input number.
Definition: numeric.hpp:188
Definition: amplifier.hpp:29