I'm super new to praat parselmouth in python and I am a big fan, as it enables analyzes without Praat. So my struggle is, that I need formants in a specific sampling rate but I cant change it here. If I change the time_step (and also time window), length of the formant list is not changing. I am mainly using this code: # http://blog.syntheticspeech.de/2021/03/10/how-to-extract-formant-tracks-with-praat-and-python/
and it looks like that
f0min= 75
f0max=300
pointProcess = praat.call(sound, "To PointProcess (periodic, cc)", f0min, f0max)
time_step = 0.01 # or 0.002 see picture
max_formant_num = 5
max_formant_freq = 5000 # men 5000, women 5500
window_length = 0.01 # or 0.002 see picture
preemphasis = 50
formants = praat.call(sound, "To Formant (burg)", time_step, max_formant_num, max_formant_freq, window_length, preemphasis)
numPoints = praat.call(pointProcess, "Get number of points")
print(numPoints)
f1_list = []
f2_list = []
f3_list = []
for point in range(0, numPoints):
point += 1
t = praat.call(pointProcess, "Get time from index", point)
f1 = praat.call(formants, "Get value at time", 1, t, 'Hertz', 'Linear')
f2 = praat.call(formants, "Get value at time", 2, t, 'Hertz', 'Linear')
f3 = praat.call(formants, "Get value at time", 3, t, 'Hertz', 'Linear')
f1_list.append(f1)
f2_list.append(f2)
f3_list.append(f3)
I can not get the sample rate I'd like (eg 30 Hz). Can someone help?
here I am plotting f1 for both time_steps, but it is still the same length (323) and timepoints