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

Function nearest_upsample_f0

src/framework/modules/hift_vocoder.cpp:413–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413std::vector<float> nearest_upsample_f0(const std::vector<float> & f0, int64_t frames, int64_t scale) {
414 if (static_cast<int64_t>(f0.size()) != frames) {
415 throw std::runtime_error("HiFT F0 shape mismatch");
416 }
417 std::vector<float> out(static_cast<size_t>(frames * scale), 0.0F);
418 for (int64_t t = 0; t < frames; ++t) {
419 std::fill(
420 out.begin() + static_cast<std::ptrdiff_t>(t * scale),
421 out.begin() + static_cast<std::ptrdiff_t>((t + 1) * scale),
422 f0[static_cast<size_t>(t)]);
423 }
424 return out;
425}
426
427std::vector<float> make_sine_source(
428 const HiftVocoderWeights & weights,

Callers 1

runMethod · 0.85

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected