11#ifndef __AUDACITY_NUMBER_SCALE__
12#define __AUDACITY_NUMBER_SCALE__
99 return !(*
this == other);
104 return 1127 * log(1 + hz / 700);
109 return 700 * (exp(mel / 1127) - 1);
115 const float z1 = 26.81 * hz / (1960 + hz) - 0.53;
117 return z1 + 0.15 * (2.0 - z1);
119 return z1 + 0.22 * (z1 - 20.1);
127 z1 = 2.0 + (z1 - 2.0) / 0.85;
129 z1 = 20.1 + (z1 - 20.1) / 1.22;
130 return 1960 * (z1 + 0.53) / (26.28 - z1);
135 return 11.17268 * log(1 + (46.06538 * hz) / (hz + 14678.49));
140 return 676170.4 / (47.06538 - exp(0.08950404 * erb)) - 14678.49;
145 return -1.0 / std::max (1.0f, hz);
249 nPositions == 1 ? 1 : exp((
mValue1 -
mValue0) / (nPositions - 1)),
Iterator(NumberScaleType type, float step, float value)
const NumberScaleType mType
static float hzToPeriod(float hz)
float PositionToValue(float pp) const
static float erbToHz(float erb)
static float hzToErb(float hz)
bool operator==(const NumberScale &other) const
static float hzToBark(float hz)
Iterator begin(float nPositions) const
NumberScale Reversal() const
float ValueToPosition(float val) const
static float periodToHz(float u)
NumberScale(NumberScaleType type, float value0, float value1)
static float barkToHz(float z1)
bool operator!=(const NumberScale &other) const
static float hzToMel(float hz)
static float melToHz(float mel)
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)