@@ -50,93 +50,93 @@ def process(self):
5050 """measure jitter"""
5151
5252 voice = self .args ["voice" ]
53- # try:
54- print (self .args ["Measure PCA" ])
55- # Call the provided pitch bounds functions
56- pitch_floor = self .args ["Pitch Floor" ]
57- pitch_ceiling = self .args ["Pitch Ceiling" ]
58-
59- start_time = self .args ["start_time" ]
60- end_time = self .args ["end_time" ]
61- shortest_period = self .args ["shortest_period" ]
62- longest_period = self .args ["longest_period" ]
63- max_period_factor = self .args ["maximum_period_factor" ]
64-
65- point_process : object = call (
66- voice , "To PointProcess (periodic, cc)" , pitch_floor , pitch_ceiling
67- )
68-
69- local_jitter : float = call (
70- point_process ,
71- "Get jitter (local)" ,
72- start_time ,
73- end_time ,
74- shortest_period ,
75- longest_period ,
76- max_period_factor ,
77- )
78-
79- localabsolute_jitter : float = call (
80- point_process ,
81- "Get jitter (local, absolute)" ,
82- start_time ,
83- end_time ,
84- shortest_period ,
85- longest_period ,
86- max_period_factor ,
87- )
88-
89- rap_jitter : float = call (
90- point_process ,
91- "Get jitter (rap)" ,
92- start_time ,
93- end_time ,
94- shortest_period ,
95- longest_period ,
96- max_period_factor ,
97- )
98-
99- ppq5_jitter : float = call (
100- point_process ,
101- "Get jitter (ppq5)" ,
102- start_time ,
103- end_time ,
104- shortest_period ,
105- longest_period ,
106- max_period_factor ,
107- )
108-
109- ddp_jitter : float = call (
110- point_process ,
111- "Get jitter (ddp)" ,
112- start_time ,
113- end_time ,
114- shortest_period ,
115- longest_period ,
116- max_period_factor ,
117- )
118-
119- self .state ["local_jitter_list" ].append (local_jitter )
120- self .state ["localabsolute_jitter_list" ].append (localabsolute_jitter )
121- self .state ["rap_jitter_list" ].append (rap_jitter )
122- self .state ["ppq5_jitter_list" ].append (ppq5_jitter )
123- self .state ["ddp_jitter_list" ].append (ddp_jitter )
124-
125- return {
126- "Local Jitter" : local_jitter ,
127- "Local Absolute Jitter" : localabsolute_jitter ,
128- "RAP Jitter" : rap_jitter ,
129- "ppq5 Jitter" : ppq5_jitter ,
130- "ddp Jitter" : ddp_jitter ,
131- }
132- # except:
133- # return {
134- # "Local Jitter": "Jitter Measurement Failed",
135- # "Local Absolute Jitter": "Jitter Measurement Failed",
136- # "RAP Jitter": "Jitter Measurement Failed",
137- # "ppq5 Jitter": "Jitter Measurement Failed",
138- # "ddp Jitter": "Jitter Measurement Failed",
139- # }
53+ try :
54+ print (self .args ["Measure PCA" ])
55+ # Call the provided pitch bounds functions
56+ pitch_floor = self .args ["Pitch Floor" ]
57+ pitch_ceiling = self .args ["Pitch Ceiling" ]
58+
59+ start_time = self .args ["start_time" ]
60+ end_time = self .args ["end_time" ]
61+ shortest_period = self .args ["shortest_period" ]
62+ longest_period = self .args ["longest_period" ]
63+ max_period_factor = self .args ["maximum_period_factor" ]
64+
65+ point_process : object = call (
66+ voice , "To PointProcess (periodic, cc)" , pitch_floor , pitch_ceiling
67+ )
68+
69+ local_jitter : float = call (
70+ point_process ,
71+ "Get jitter (local)" ,
72+ start_time ,
73+ end_time ,
74+ shortest_period ,
75+ longest_period ,
76+ max_period_factor ,
77+ )
78+
79+ localabsolute_jitter : float = call (
80+ point_process ,
81+ "Get jitter (local, absolute)" ,
82+ start_time ,
83+ end_time ,
84+ shortest_period ,
85+ longest_period ,
86+ max_period_factor ,
87+ )
88+
89+ rap_jitter : float = call (
90+ point_process ,
91+ "Get jitter (rap)" ,
92+ start_time ,
93+ end_time ,
94+ shortest_period ,
95+ longest_period ,
96+ max_period_factor ,
97+ )
98+
99+ ppq5_jitter : float = call (
100+ point_process ,
101+ "Get jitter (ppq5)" ,
102+ start_time ,
103+ end_time ,
104+ shortest_period ,
105+ longest_period ,
106+ max_period_factor ,
107+ )
108+
109+ ddp_jitter : float = call (
110+ point_process ,
111+ "Get jitter (ddp)" ,
112+ start_time ,
113+ end_time ,
114+ shortest_period ,
115+ longest_period ,
116+ max_period_factor ,
117+ )
118+
119+ self .state ["local_jitter_list" ].append (local_jitter )
120+ self .state ["localabsolute_jitter_list" ].append (localabsolute_jitter )
121+ self .state ["rap_jitter_list" ].append (rap_jitter )
122+ self .state ["ppq5_jitter_list" ].append (ppq5_jitter )
123+ self .state ["ddp_jitter_list" ].append (ddp_jitter )
124+
125+ return {
126+ "Local Jitter" : local_jitter ,
127+ "Local Absolute Jitter" : localabsolute_jitter ,
128+ "RAP Jitter" : rap_jitter ,
129+ "ppq5 Jitter" : ppq5_jitter ,
130+ "ddp Jitter" : ddp_jitter ,
131+ }
132+ except :
133+ return {
134+ "Local Jitter" : "Jitter Measurement Failed" ,
135+ "Local Absolute Jitter" : "Jitter Measurement Failed" ,
136+ "RAP Jitter" : "Jitter Measurement Failed" ,
137+ "ppq5 Jitter" : "Jitter Measurement Failed" ,
138+ "ddp Jitter" : "Jitter Measurement Failed" ,
139+ }
140140
141141 def jitter_pca (self ):
142142 local_jitter_list = self .state ["local_jitter_list" ]
0 commit comments