Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1033051 // FindBest1DHaarFeature

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (6650L) is out of date.

sclass FindBest1DHaarFeature extends Best<HamburgerAudioHaarFeature> {
  IAudioSample sample;
  DoubleRange range;
  
  *(IAudioSample *sample) {
    range = sample.bounds();
  }
  
  void tryIt(HamburgerAudioHaarFeature f) {
    if (f == null) ret;
    f.pinOuter(range);
    if (!f.ok()) ret;
    double score = score(f);
    put(f, score);
    put(f.inverted(), -score);
  }
  
  double score(HamburgerAudioHaarFeature f) {
    ret f.get(0);
  }
  
  HamburgerAudioHaarFeature initial() {
    HamburgerAudioHaarFeature feature = new(sample, spreadEvenly(4, range));
    tryIt(feature);
    ret feature;
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033051
Snippet name: FindBest1DHaarFeature
Eternal ID of this version: #1033051/6
Text MD5: c71fb22c5104dd611ef5ebf1012e749e
Author: stefan
Category: javax / audio analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-11 19:33:32
Source code size: 637 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 97 / 182
Version history: 5 change(s)
Referenced in: [show references]