27 #ifndef EDSP_SPECTRAL_DECREASE_HPP 28 #define EDSP_SPECTRAL_DECREASE_HPP 30 #include <edsp/meta/expects.hpp> 32 namespace edsp {
namespace feature {
inline namespace spectral {
49 template <
typename ForwardIt>
51 using input_t =
typename std::iterator_traits<ForwardIt>::value_type;
52 auto weighted_sum =
static_cast<input_t
>(0);
53 auto unweighted_sum =
static_cast<input_t
>(0);
54 for (input_t i = 0, initial = *first; first != last; ++first, ++i) {
55 weighted_sum += ((*first) - initial) / i;
56 unweighted_sum += *first;
58 return weighted_sum / unweighted_sum;
65 #endif //EDSP_SPECTRAL_DECREASE_HPP constexpr auto spectral_decrease(ForwardIt first, ForwardIt last)
Computes the spectral decrease of the of the magnitude spectrum represented by the elements in the ra...
Definition: spectral_decrease.hpp:50
Definition: amplifier.hpp:29