20201110

tg1 = selected("TextGrid") fo1 = selected("Formant")

selectObject: fo1 ta1 = Down to Table: "no", "yes", 3, "no", 3, "yes", 1, "no" Append column: "label" n_r = Get number of rows for i from 1 to n_r

	t[i] = Get value: i, "time(s)"

endfor

selectObject: tg1 for i from 1 to n_r

	iv = Get interval at time: 1, t[i]
	li = Get label of interval: 1, iv

endfor

selectObject: ta1 for i from 1 to n_r

	Set string value: i, "label", li

endfor

tor1 = Down to TableOfReal: "label" tor2 = Extract rows where label: "is not equal to", ""

Remove column (index): 1 Remove column (index): 1 Remove column (index): 3 Remove column (index): 3 Remove column (index): 3

ta2 = To Table: "rowLabel" f1min = Get minimum: "F1(Hz)" f1max = Get maximum: "F1(Hz)" f2min = Get minimum: "F2(Hz)" f2max = Get maximum: "F2(Hz)"

selectObject: tor2 discriminant = To Discriminant

Draw sigma ellipses: 1, "no", 2, 1, f2max, f2min, f1max, f1min, 12, "yes"