MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / hz_to_mel

Function hz_to_mel

src/framework/audio/dsp.cpp:49–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49float hz_to_mel(float hz) {
50 constexpr float kFsp = 200.0f / 3.0f;
51 constexpr float kMinLogHz = 1000.0f;
52 constexpr float kMinLogMel = kMinLogHz / kFsp;
53 constexpr float kLogstep = 0.06875177742094912f; // ln(6.4) / 27
54 if (hz >= kMinLogHz) {
55 return kMinLogMel + std::log(hz / kMinLogHz) / kLogstep;
56 }
57 return hz / kFsp;
58}
59
60float mel_to_hz(float mel) {
61 constexpr float kFsp = 200.0f / 3.0f;

Callers 2

make_mel_filterbankFunction · 0.70
compute_rmvpe_log_melFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected