33 namespace edsp {
namespace feature {
inline namespace temporal {
52 template <
typename InputIt,
typename OutputIt>
53 constexpr
void amdf(InputIt first, InputIt last, OutputIt d_first) {
54 using value_type =
typename std::iterator_traits<OutputIt>::value_type;
55 value_type accumulated = 0;
56 for (++first; first != last;) {
59 return accumulated /
static_cast<value_type
>(
std::distance(first, last));
65 #endif //EDSP_AZCR_HPP constexpr T distance(T x, T y) noexcept
Computes the distance between x and y.
Definition: numeric.hpp:328
constexpr void amdf(InputIt first, InputIt last, OutputIt d_first)
Computes the AMDF (Average Magnitude Difference Function) of the contiguous elements in the range [fi...
Definition: amdf.hpp:51
constexpr T sign(T x) noexcept
Determines the sign of the input number.
Definition: numeric.hpp:155
Definition: amplifier.hpp:29