1

我想知道是否有人可以帮助我解决一个棘手的问题,即将 Praat Pitch 轮廓的时间和频率提取到 txt 文件中。

我从

File type = "ooTextFile"
Object class = "Pitch 1"

xmin = 0 
xmax = 1.592 
nx = 159 
dx = 0.01 
x1 = 0.006002267573695814 
ceiling = 1900 
maxnCandidates = 2 
frame []: 
    frame [1]:
        intensity = 0 
        nCandidates = 1 
        candidate []: 
            candidate [1]:
                frequency = 0 
                strength = 0.9 
    frame [2]:
        intensity = 0 
        nCandidates = 1 
        candidate []: 
            candidate [1]:
                frequency = 0 
                strength = 0.9 
    frame [3]:
        intensity = 0 
        nCandidates = 1 
        candidate []: 
            candidate [1]:
                frequency = 763.0480724135344 
                strength = 0.9 
    frame [4]:
        intensity = 0 
        nCandidates = 1 
        candidate []: 
            candidate [1]:
                frequency = 763.3612753914916 
                strength = 0.9 
....

我想去:

0,0
t1,0
t2,763.0480724135344
t3,763.3612753914916 
....
tn, ...

如果脚本可以读取“dx =”中的信息并计算 x 坐标的时间,那就太好了。

在此先感谢您的帮助。

4

1 回答 1

1

我一直在研究一些程序来快速将不同的对象类型转换为它们的表表示,并且Pitch对象相对简单。尝试这个:

# Execute this with your Pitch object selected
@pitchToTable()

procedure pitchToTable ()
  .obj = selected("Pitch")
  .name$ = extractWord$(selected$(), " ")
  .t1 = Get time from frame number: 1
  .m1  = To Matrix
  .m2  = Transpose
  .tor = To TableOfReal
  .id  = To Table: "Time"
  Set column label (index): 2, "F0"
  Formula: "Time", "'.t1' + (Object_'.obj'.dx * (row - 1))"
  Formula: "F0", "if self then self else undefined fi"
  Rename: .name$ + "_pitch"
  removeObject: .m1, .m2, .tor
endproc

转换利用了大多数 Praat 对象可以转换为 Matrix 对象的事实,该对象基本上已经是一个 Table。在这种情况下,唯一需要进行的操作是转置(以获得垂直表)和重命名列。

于 2016-07-22T00:33:44.943 回答