Skip to content

Instantly share code, notes, and snippets.

@cvonk
Created May 9, 2022 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cvonk/4d690fa8a9057e7369e7ea082e01da29 to your computer and use it in GitHub Desktop.
Save cvonk/4d690fa8a9057e7369e7ea082e01da29 to your computer and use it in GitHub Desktop.
static autoCorr_t
_auto_corr(samples_t const samples, samplesLag_t const lag)
{
autoCorr_t ac = 0;
for (sample_cnt_t ii = 0; ii < CONFIG_MIDIMIKE_WINDOW_SIZE - lag; ii++) {
ac += ((int16_t)samples[ii] * samples[ii + lag]);
}
return ac;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment