% phoneme   // Find phoneme closest to y array.
ysave = y;
yseg = y(1:2049);
load handel
ahphone = y(2000:4048)*0.3;
ayphone = y(8500:10548)*0.3;
oophone = y(11000:13048)*0.3;
phonediff_ah = sum((yseg - ahphone).^2);
phonediff_ay = sum((yseg - ayphone).^2);
phonediff_oo = sum((yseg - oophone).^2);

phonediffs = ...
  [phonediff_ah, phonediff_ay, phonediff_oo];
[mindiff, phonenum] = min(phonediffs);

if phonenum == 1
  display('ah')
else
  if phonenum == 2
    display('ay')
  else
    display('oo')
  end
end

y = ysave;

