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

Function sparse_mel_ends

src/framework/audio/dsp.cpp:233–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233std::vector<int64_t> sparse_mel_ends(const AudioTensor & filterbank) {
234 const int64_t n_mels = filterbank.shape[0];
235 const int64_t freq_bins = filterbank.shape[1];
236 std::vector<int64_t> ends(static_cast<size_t>(n_mels), freq_bins);
237 for (int64_t mel = 0; mel < n_mels; ++mel) {
238 int64_t end = freq_bins;
239 while (end > 0 && filterbank.values[static_cast<size_t>(mel * freq_bins + end - 1)] == 0.0f) {
240 --end;
241 }
242 ends[static_cast<size_t>(mel)] = end;
243 }
244 return ends;
245}
246
247FeatureNormalizeOutput normalize_batch_impl(
248 const std::vector<float> & features,

Callers 1

prepare_sparseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected