% create a plot with the vowel space
N = 1000;
sz=3;


V_a = zeros(N,2);
% vowel space
for i=1:N
    [f1, f2] = vowel.sample(lang1_sound.A.f1_erb, lang1_sound.A.f2_erb);
    V_a(i, :) = [f1 f2];
end
scatter(V_a(:,2),V_a(:,1), sz, "red");

hold on
V_e = zeros(N,2);
% vowel space
for i=1:N
    [f1, f2] = vowel.sample(lang1_sound.E.f1_erb, lang1_sound.E.f2_erb);
    V_e(i, :) = [f1 f2];
end
scatter(V_e(:,2),V_e(:,1), sz, "blue");

hold on
V_i = zeros(N,2);
% vowel space
for i=1:N
    [f1, f2] = vowel.sample(lang1_sound.I.f1_erb, lang1_sound.I.f2_erb);
    V_i(i, :) = [f1 f2];
end
scatter(V_i(:,2),V_i(:,1), sz, "green");

hold on
V_o = zeros(N,2);
% vowel space
for i=1:N
    [f1, f2] = vowel.sample(lang1_sound.O.f1_erb, lang1_sound.O.f2_erb);
    V_o(i, :) = [f1 f2];
end
scatter(V_o(:,2),V_o(:,1), sz, "magenta");

hold on
V_u = zeros(N,2);
% vowel space
for i=1:N
    [f1, f2] = vowel.sample(lang1_sound.U.f1_erb, lang1_sound.U.f2_erb);
    V_u(i, :) = [f1 f2];
end
scatter(V_u(:,2),V_u(:,1), sz, "black");

legend('a', 'e', 'i', 'o', 'u', 'Location', 'southeast', 'Fontname', 'courier')
xlabel('F2 (erb)')
ylabel('F1 (erb)')

set(gca, 'Fontname', 'courier')
set(gca, 'XDir', 'reverse')
set(gca, 'YDir', 'reverse')
set(gca, 'XGrid', 'on')
set(gca, 'YGrid', 'on')
set(gca, 'XMinorGrid', 'on')
set(gca, 'YMinorGrid', 'on')
set(gca, 'XAxisLocation', 'top')
set(gca, 'YAxisLocation', 'right')


