libs/Music/Autocorrelation.h
raw| 1 | #ifndef _Autocorrelation_h_ |
| 2 | #define _Autocorrelation_h_ |
| 3 | |
| 4 | /* Compute the autocorrelation |
| 5 | * ,--, |
| 6 | * ac(i) = > x(n) * x(n-i) for all n |
| 7 | * `--' |
| 8 | * for lags between 0 and lag-1, and x == 0 outside 0...n-1 |
| 9 | */ |
| 10 | void autocorrelation( |
| 11 | int n, double const * x, /* in: [0...n-1] samples x */ |
| 12 | int lag, double * ac); /* out: [0...lag-1] ac values */ |
| 13 | |
| 14 | #endif |