Wayverb
Main Page
Related Pages
Classes
Files
File List
decibels.h
1
#pragma once
2
3
#include <cmath>
4
5
namespace
util
{
6
namespace
decibels {
7
8
template
<
typename
T>
9
inline
T p2db(T p) {
10
using
std::pow;
11
return
10 * log10(p);
12
}
13
14
template
<
typename
T>
15
inline
T db2p(T db) {
16
using
std::pow;
17
return
pow(10, db / 10);
18
}
19
20
template
<
typename
T>
21
inline
T a2db(T a) {
22
using
std::log10;
23
return
20 * log10(a);
24
}
25
26
template
<
typename
T>
27
inline
T db2a(T db) {
28
using
std::pow;
29
return
pow(10, db / 20);
30
}
31
32
}
// namespace decibels
33
}
// namespace util
util
Definition:
allocator.h:6
src
utilities
include
utilities
decibels.h
Generated by
1.8.11