Libraryless. Click here for Pure Java version (67L/1K).
1 | static double autocorrelation(double[] voiceSample) {
|
2 | int n = voiceSample.length; |
3 | double sum = 0; |
4 | for j to n: {
|
5 | double correlation = 0; |
6 | for i to n: |
7 | correlation += voiceSample[i] * voiceSample[mod(i - j, n)]; |
8 | sum += correlation; |
9 | } |
10 | ret doubleRatio(sum, n); |
11 | } |
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: | 471 / 572 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |