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

15
LINES

< > BotCompany Repo | #1026898 // Test normalized normalizedAutocorrelationOfAudioSamples sanity [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (7290L/51K).

!7
p-exp {
  short[] x = new[44];
  for i over x: x[i] = (short) random(-100, 100);
  double a = autocorrelationOfAudioSamples(x);
  double aa = normalizedAutocorrelationOfAudioSamples(x);
  print(a);
  for i over x: x[i] *= 2;
  double b = autocorrelationOfAudioSamples(x);
  double bb = normalizedAutocorrelationOfAudioSamples(x);
  print(b);
  print(doubleRatio(b, a)); // should be 4
  print(aa + " " + bb);
  print(doubleRatio(bb, aa)); // should be 1
}

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: #1026898
Snippet name: Test normalized normalizedAutocorrelationOfAudioSamples sanity [OK]
Eternal ID of this version: #1026898/2
Text MD5: ec14e65af44c973e16b790a9cc766896
Transpilation MD5: ab5005ca96d361ce27b20c96af342ecb
Author: stefan
Category: javax / audio
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-02 15:28:52
Source code size: 472 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 172 / 656
Version history: 1 change(s)
Referenced in: [show references]