23 #ifndef EDSP_HERTZ2MEL_HPP 24 #define EDSP_HERTZ2MEL_HPP 27 namespace edsp {
inline namespace converter {
39 template <mel_base scale>
43 struct converter<mel_base::
base_e> {
45 constexpr T operator()(T f) noexcept {
46 return 1127.01048 * std::log(f / 700.0 + 1.0);
51 struct converter<mel_base::
base_10> {
53 constexpr T operator()(T f) noexcept {
54 return 2595.0 * std::log10(f / 700.0 + 1.0);
71 template <mel_base scale,
typename T>
73 return internal::converter<scale, T>{}(f);
78 #endif //EDSP_HERTZ2MEL_HPP mel_base
Definition: hertz2mel.hpp:32
Definition: hertz2mel.hpp:34
Definition: amplifier.hpp:29
Definition: hertz2mel.hpp:33
constexpr T hertz2mel(T f) noexcept
Converts a frequency in Hertz into mels.
Definition: hertz2mel.hpp:72