PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
293B

  1. % Talkie library
  2. % Copyright 2011 Peter Knight
  3. % This code is released under GPLv2 license.
  4. %
  5. % Calculate autocorrelation of speech segment
  6. function r = autocorrelate(w,len)
  7. r = zeros(1,len);
  8. wlen = length(w);
  9. for n=1:len
  10. r(n) = sum( w(1:wlen-n+1) .* w(n:wlen) );
  11. end