#This work is licensed under the
#Creative Commons Attribution-Share Alike 3.0 United States License.
#To view a copy of this license, visit
#http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to
#Creative Commons,
#171 Second Street, Suite 300,
#San Francisco, California, 94105, USA.

INPUT window,sample_count,max_LPC;
OUTPUT "a list of floating point autocorrelation values";
VAR sample_count "sample count";
VAR window "windowed";
VAR autocorrelated "autocorrelated";
VAR max_LPC "maximum LPC order";
for l <- 0 to (max_LPC + 1) {
    autocorrelated[l] <-
        sum i <- 0 to sample_count - l - 1 {window[i] * window[i + l]};
}
return autocorrelated;
