eDSP  0.0.1
A cross-platform DSP library written in C++.
loudness.hpp
Go to the documentation of this file.
1 
27 #ifndef EDSP_LOUDNESS_HPP
28 #define EDSP_LOUDNESS_HPP
29 
31 #include <cmath>
32 
33 namespace edsp { namespace feature { inline namespace perceptual {
34 
58  template <typename ForwardIt>
59  constexpr auto loudness(ForwardIt first, ForwardIt last) {
60  const auto e = temporal::energy(first, last);
61  return std::pow(e, 0.67);
62  }
63 
64 }}}
65 
66 #endif //EDSP_LOUDNESS_HPP
constexpr auto loudness(ForwardIt first, ForwardIt last)
Computes the loudness of the elements in the range [first, last)
Definition: loudness.hpp:59
constexpr auto energy(ForwardIt first, ForwardIt last)
Computes the energy of the elements in the range [first, last)
Definition: energy.hpp:46
Definition: amplifier.hpp:29