/ proof-of-concept / instrawave-compose
Sign in
proof-of-concept / instrawave-compose
instrawave-compose / src / numbl / index.ts
18 lines · 858 BCodeBlameHistory
2import silenceGapKnnSrc from './silence_gap_knn.m?raw';
4export const DEFAULT_CLASSIFIER_NAME = 'silence_gap_knn';
5export const DEFAULT_CLASSIFIER_SOURCE = silenceGapKnnSrc;
7export const CUSTOM_CLASSIFIER_TEMPLATE = `function [times, labels] = my_classifier(x, fs, training)
8% x the take, column vector at fs Hz (16 kHz)
9% training struct: snips {1 x nVoices} cell of [snipLen x nSnips]
10% matrices (columns are training snippets), names {1 x nVoices},
11% pre (samples before the hit onset within each snippet)
12% Return column vectors: hit times in seconds and 1-based voice indices.
13% The same interface as the audio-spike-sorting benchmark, so an
14% algorithm developed there drops in here unchanged.
15times = zeros(0, 1);
16labels = zeros(0, 1);
17end
18`;
↑↓ move↵openescclose