Skip to contents

Convert a Praat Pitch tier to a dataframe.

Usage

pitch_to_df(file_name, candidates = "")

Arguments

file_name

string with a filename or path to the Pitch tier

candidates

Praat Pitch tier contains multiple candidates for each time slice, use the value "all" if you want to get them all

Value

a dataframe with columns: time_start, time_end, frequency and, if candidates = "all", candidate_id and strength

Author

George Moroz <agricolamz@gmail.com>

Examples

pitch_to_df(system.file("extdata", "test.Pitch", package = "phonfieldwork"))
#>    frequency time_start   time_end
#> 1         NA 0.00000000 0.00000000
#> 2         NA 0.01069960 0.01069960
#> 3         NA 0.02139920 0.02139920
#> 4         NA 0.03209881 0.03209881
#> 5         NA 0.04279841 0.04279841
#> 6         NA 0.05349801 0.05349801
#> 7         NA 0.06419761 0.06419761
#> 8         NA 0.07489722 0.07489722
#> 9         NA 0.08559682 0.08559682
#> 10        NA 0.09629642 0.09629642
#> 11        NA 0.10699602 0.10699602
#> 12        NA 0.11769562 0.11769562
#> 13        NA 0.12839523 0.12839523
#> 14        NA 0.13909483 0.13909483
#> 15        NA 0.14979443 0.14979443
#> 16        NA 0.16049403 0.16049403
#> 17        NA 0.17119364 0.17119364
#> 18        NA 0.18189324 0.18189324
#> 19        NA 0.19259284 0.19259284
#> 20        NA 0.20329244 0.20329244
#> 21        NA 0.21399204 0.21399204
#> 22        NA 0.22469165 0.22469165
#> 23 146.61622 0.23539125 0.23539125
#> 24 144.76135 0.24609085 0.24609085
#> 25 138.85260 0.25679045 0.25679045
#> 26 130.18431 0.26749006 0.26749006
#> 27 124.02896 0.27818966 0.27818966
#> 28 118.84340 0.28888926 0.28888926
#> 29 113.51198 0.29958886 0.29958886
#> 30 109.37077 0.31028847 0.31028847
#> 31 106.92832 0.32098807 0.32098807
#> 32 104.62232 0.33168767 0.33168767
#> 33 104.13490 0.34238727 0.34238727
#> 34 101.50702 0.35308687 0.35308687
#> 35 100.47670 0.36378648 0.36378648
#> 36 101.28989 0.37448608 0.37448608
#> 37  99.80511 0.38518568 0.38518568
#> 38        NA 0.39588528 0.39588528
#> 39        NA 0.40658489 0.40658489
#> 40        NA 0.41728449 0.41728449
#> 41        NA 0.42798409 0.42798409
#> 42        NA 0.43868369 0.43868369
#> 43        NA 0.44938329 0.44938329
#> 44        NA 0.46008290 0.46008290
#> 45        NA 0.47078250 0.47078250
#> 46        NA 0.48148210 0.48148210
#> 47        NA 0.49218170 0.49218170
#> 48        NA 0.50288131 0.50288131
#> 49        NA 0.51358091 0.51358091
#> 50        NA 0.52428051 0.52428051
#> 51        NA 0.53498011 0.53498011
#> 52        NA 0.54567971 0.54567971
#> 53        NA 0.55637932 0.55637932
#> 54        NA 0.56707892 0.56707892
#> 55        NA 0.57777852 0.57777852
#> 56        NA 0.58847812 0.58847812
#> 57        NA 0.59917773 0.59917773
#> 58        NA 0.60987733 0.60987733
#> 59        NA 0.62057693 0.62057693
#> 60        NA 0.63127653 0.63127653
#> 61        NA 0.64197613 0.64197613
#> 62        NA 0.65267574 0.65267574