PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

18 rindas
535B

  1. % Talkie library
  2. % Copyright 2011 Peter Knight
  3. % This code is released under GPLv2 license.
  4. %
  5. % Home in on best fit pitch
  6. function [pitch,score] = pitchRefine(w,pitchGuess,pitchRange,sampleRate)
  7. score = 0;
  8. phase = (1:length(w))*2*pi/sampleRate;
  9. for (newGuess = pitchGuess-pitchRange:pitchRange/10:pitchGuess+pitchRange)
  10. signal = exp(i*(newGuess*phase))';
  11. pitchScore = abs(mean(w .* signal));
  12. if (pitchScore > score)
  13. score = pitchScore;
  14. pitch = newGuess;
  15. end
  16. end