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

11
LINES

< > BotCompany Repo | #1026886 // autocorrelation

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

Libraryless. Click here for Pure Java version (67L/1K).

static double autocorrelation(double[] voiceSample) {
  int n = voiceSample.length;
  double sum = 0;
  for j to n: {
    double correlation = 0;
    for i to n:
      correlation += voiceSample[i] * voiceSample[mod(i - j, n)];
    sum += correlation;
  }
  ret doubleRatio(sum, n);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026886
Snippet name: autocorrelation
Eternal ID of this version: #1026886/2
Text MD5: 3a3f50a34e88dad34e2f824c1b085eb9
Transpilation MD5: 85af08bf8dbd3583d209e348c627c72b
Author: stefan
Category: javax / audio
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-02 12:48:44
Source code size: 294 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 261 / 324
Version history: 1 change(s)
Referenced in: [show references]