Use waveform payload classification
This commit is contained in:
parent
ca6b936d63
commit
957f0836a4
2 changed files with 25 additions and 24 deletions
|
|
@ -2153,17 +2153,15 @@ static IReadOnlyDictionary<ulong, int> ClassifyContestantPayloads(
|
|||
continue;
|
||||
}
|
||||
|
||||
var feature = CepstralFingerprintWithOptions(samples.AsSpan(offset, motifSamples), sampleRate, options);
|
||||
var bestPayload = 0;
|
||||
var bestDistance = double.PositiveInfinity;
|
||||
var bestScore = double.NegativeInfinity;
|
||||
for (var payload = 0; payload < payloadCount; payload++)
|
||||
{
|
||||
var template = contestant.RenderEventMonoFloat(observation.EventIndex, sampleRate, payload);
|
||||
var templateFeature = CepstralFingerprintWithOptions(template, sampleRate, options);
|
||||
var distance = CepstralDistance(feature, templateFeature);
|
||||
if (distance < bestDistance)
|
||||
var score = ScoreContestantOffset(samples, template, offset, motifSamples);
|
||||
if (score > bestScore)
|
||||
{
|
||||
bestDistance = distance;
|
||||
bestScore = score;
|
||||
bestPayload = payload;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue