daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Oct 12th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %WORKING WITH HILBERT Data
  2. %Import Hilber
  3. fileID = 'vowdata.txt';
  4. formatSpec = '%s %4.1f %4.1f %4.1f %4.1f %4.1f %4.1f%4.1f %4.1f %4.1f %4.1f %4.1f %4.1f %4.1f %4.1f%4.1f';
  5. [filenames,dur,F0s,F1s,F2s,F3s,F4s,F120,F220,F320,F150,F250,F350,F180,F280,F380] = textread(fileID,formatSpec);
  6. filenames=char(filenames);
  7.  
  8. %vowel (ae="had", ah="hod", aw="hawed", eh="head", er="heard",
  9. %                        ei="haid", ih="hid", iy="heed", oa=/o/ as in "boat",
  10. %                        oo="hood", uh="hud", uw="who'd")
  11.  
  12. %Config
  13. vowel_codes = char('ae','ah','aw','eh','er','ei','ih','iy','oa','oo','uh','uw');
  14. vowels = char('had','hod','hawed','head','head','heard','haid','hid','heed','boat','hood','hud','whod');
  15. gender = 'm';
  16. figure;
  17. hold on;
  18. sd = 1;
  19. color = 'r'
  20.  
  21. for ivow=1:12;
  22.     vowel = vowels(ivow,:)
  23.     vowel_code = vowel_codes(ivow,:)
  24.     ind = find(filenames(:,1) == gender & filenames(:,end-1) == vowel_code(1) & filenames(:,end) == vowel_code(2)); % had
  25.     plot( F150( ind,: ), F250( ind,: ), ['.',color], 'MarkerSize', 2 ); % red dots, size 12
  26.  
  27.     text( mean(F150( ind,: )), mean(F250( ind,: )), vowel);
  28.     z = ellipse( F150( ind,: ), F250( ind,: ), sd);
  29.     plot( z(:,1), z(:,2) , ['-',color]);
  30. end
  31.  
  32. %WORKING ON OWN Data
  33. %Importing
  34. fileID = 'vowel_forments_data.txt';
  35. formatSpec = '%s\t%.6f\t%.6f\t%.6f';
  36. [ad_vowels,ad_F1,ad_F2,ad_F3] = textread(fileID,formatSpec);
  37. ad_vowels=char(ad_vowels);
  38.  
  39. %Config
  40. color = 'b';
  41. ad_F1 = ad_F1 * 1000;
  42. ad_F2 = ad_F2 * 1000;
  43. ad_F3 = ad_F3 * 1000;
  44.  
  45. for ivow=1:12;
  46.     vowel = ad_vowels(ivow,:);
  47.     disp(vowel);
  48.     plot( ad_F1(ivow,:), ad_F2(ivow,:), ['.',color], 'MarkerSize', 30 );
  49.     text( ad_F1(ivow,:), ad_F2(ivow,:), vowel);
  50. end
  51.  
  52.  
  53. set(gca, 'XScale', 'log', 'YScale', 'log');
RAW Paste Data
Top