comparison Code/Descriptors/Matlab/MPEG7/FromWeb/VoiceSauce/vs_Settings_Praat.m @ 4:92ca03a8fa99 tip

Update to ICASSP 2013 benchmark
author Dawn Black
date Wed, 13 Feb 2013 11:02:39 +0000
parents
children
comparison
equal deleted inserted replaced
3:e1cfa7765647 4:92ca03a8fa99
1 function varargout = vs_Settings_Praat(varargin)
2 % VS_SETTINGS_PRAAT M-file for vs_Settings_Praat.fig
3 % VS_SETTINGS_PRAAT, by itself, creates a new VS_SETTINGS_PRAAT or raises the existing
4 % singleton*.
5 %
6 % H = VS_SETTINGS_PRAAT returns the handle to a new VS_SETTINGS_PRAAT or the handle to
7 % the existing singleton*.
8 %
9 % VS_SETTINGS_PRAAT('CALLBACK',hObject,eventData,handles,...) calls the local
10 % function named CALLBACK in VS_SETTINGS_PRAAT.M with the given input arguments.
11 %
12 % VS_SETTINGS_PRAAT('Property','Value',...) creates a new VS_SETTINGS_PRAAT or raises the
13 % existing singleton*. Starting from the left, property value pairs are
14 % applied to the GUI before vs_Settings_Praat_OpeningFcn gets called. An
15 % unrecognized property name or invalid value makes property application
16 % stop. All inputs are passed to vs_Settings_Praat_OpeningFcn via varargin.
17 %
18 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
19 % instance to run (singleton)".
20 %
21 % See also: GUIDE, GUIDATA, GUIHANDLES
22
23 % Edit the above text to modify the response to help vs_Settings_Praat
24
25 % Last Modified by GUIDE v2.5 08-Mar-2011 23:30:28
26
27 % Begin initialization code - DO NOT EDIT
28 gui_Singleton = 1;
29 gui_State = struct('gui_Name', mfilename, ...
30 'gui_Singleton', gui_Singleton, ...
31 'gui_OpeningFcn', @vs_Settings_Praat_OpeningFcn, ...
32 'gui_OutputFcn', @vs_Settings_Praat_OutputFcn, ...
33 'gui_LayoutFcn', [] , ...
34 'gui_Callback', []);
35 if nargin && ischar(varargin{1})
36 gui_State.gui_Callback = str2func(varargin{1});
37 end
38
39 if nargout
40 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
41 else
42 gui_mainfcn(gui_State, varargin{:});
43 end
44 % End initialization code - DO NOT EDIT
45
46
47 % --- Executes just before vs_Settings_Praat is made visible.
48 function vs_Settings_Praat_OpeningFcn(hObject, eventdata, handles, varargin)
49 % This function has no output args, see OutputFcn.
50 % hObject handle to figure
51 % eventdata reserved - to be defined in a future version of MATLAB
52 % handles structure with handles and user data (see GUIDATA)
53 % varargin command line arguments to vs_Settings_Praat (see VARARGIN)
54
55 % Choose default command line output for vs_Settings_Praat
56 handles.output = hObject;
57
58 Setfig = vs_Settings;
59 Sethandle = guidata(Setfig);
60 handles.Setfig = Setfig;
61 handles.Sethandle = Sethandle;
62 handles.VSHandle = Sethandle.VSHandle;
63
64 setGUIVariables(handles);
65
66 % Update handles structure
67 guidata(hObject, handles);
68
69 % UIWAIT makes vs_Settings_Praat wait for user response (see UIRESUME)
70 % uiwait(handles.figure1);
71
72
73 % align the variables with those in VS.vars
74 function setGUIVariables(handles)
75 VSData = guidata(handles.VSHandle);
76 vars = VSData.vars;
77
78 set(handles.edit_max_F0, 'String', num2str(vars.F0Praatmax));
79 set(handles.edit_min_F0, 'String', num2str(vars.F0Praatmin));
80
81 set(handles.edit_voice_threshold, 'String', num2str(vars.F0PraatVoiceThreshold));
82 set(handles.edit_silence_threshold, 'String', num2str(vars.F0PraatSilenceThreshold));
83 set(handles.edit_octave_cost, 'String', num2str(vars.F0PraatOctaveCost));
84 set(handles.edit_oct_j_cost, 'String', num2str(vars.F0PraatOctiveJumpCost));
85 set(handles.edit_voiced_unvoiced_cost, 'String', num2str(vars.F0PraatVoicedUnvoicedCost));
86 set(handles.edit_smoothing_bandwidth, 'String', num2str(vars.F0PraatSmoothingBandwidth));
87
88 set(handles.checkbox_kill_octave_jumps, 'Value', vars.F0PraatKillOctaveJumps);
89 set(handles.checkbox_smooth, 'Value', vars.F0PraatSmooth);
90 set(handles.checkbox_interpolate, 'Value', vars.F0PraatInterpolate);
91
92
93 % --- Outputs from this function are returned to the command line.
94 function varargout = vs_Settings_Praat_OutputFcn(hObject, eventdata, handles)
95 % varargout cell array for returning output args (see VARARGOUT);
96 % hObject handle to figure
97 % eventdata reserved - to be defined in a future version of MATLAB
98 % handles structure with handles and user data (see GUIDATA)
99
100 % Get default command line output from handles structure
101 varargout{1} = handles.output;
102
103
104
105 function edit_min_F0_Callback(hObject, eventdata, handles)
106 % hObject handle to edit_min_F0 (see GCBO)
107 % eventdata reserved - to be defined in a future version of MATLAB
108 % handles structure with handles and user data (see GUIDATA)
109
110 % Hints: get(hObject,'String') returns contents of edit_min_F0 as text
111 % str2double(get(hObject,'String')) returns contents of edit_min_F0 as a double
112 VSData = guidata(handles.VSHandle);
113 val = str2double(get(hObject, 'String'));
114
115 if (~isnan(val) && val >= 0)
116 VSData.vars.F0Praatmin = val;
117 guidata(handles.VSHandle, VSData);
118 set(hObject, 'String', num2str(val));
119 else
120 set(hObject, 'String', num2str(VSData.vars.F0Praatmin));
121 end
122
123
124
125 % --- Executes during object creation, after setting all properties.
126 function edit_min_F0_CreateFcn(hObject, eventdata, handles)
127 % hObject handle to edit_min_F0 (see GCBO)
128 % eventdata reserved - to be defined in a future version of MATLAB
129 % handles empty - handles not created until after all CreateFcns called
130
131 % Hint: edit controls usually have a white background on Windows.
132 % See ISPC and COMPUTER.
133 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
134 set(hObject,'BackgroundColor','white');
135 end
136
137
138
139 function edit_max_F0_Callback(hObject, eventdata, handles)
140 % hObject handle to edit_max_F0 (see GCBO)
141 % eventdata reserved - to be defined in a future version of MATLAB
142 % handles structure with handles and user data (see GUIDATA)
143
144 % Hints: get(hObject,'String') returns contents of edit_max_F0 as text
145 % str2double(get(hObject,'String')) returns contents of edit_max_F0 as a double
146 VSData = guidata(handles.VSHandle);
147 val = str2double(get(hObject, 'String'));
148
149 if (~isnan(val) && val >= 0)
150 VSData.vars.F0Praatmax = val;
151 guidata(handles.VSHandle, VSData);
152 set(hObject, 'String', num2str(val));
153 else
154 set(hObject, 'String', num2str(VSData.vars.F0Praatmax));
155 end
156
157
158
159
160 % --- Executes during object creation, after setting all properties.
161 function edit_max_F0_CreateFcn(hObject, eventdata, handles)
162 % hObject handle to edit_max_F0 (see GCBO)
163 % eventdata reserved - to be defined in a future version of MATLAB
164 % handles empty - handles not created until after all CreateFcns called
165
166 % Hint: edit controls usually have a white background on Windows.
167 % See ISPC and COMPUTER.
168 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
169 set(hObject,'BackgroundColor','white');
170 end
171
172
173
174 function edit_voice_threshold_Callback(hObject, eventdata, handles)
175 % hObject handle to edit_voice_threshold (see GCBO)
176 % eventdata reserved - to be defined in a future version of MATLAB
177 % handles structure with handles and user data (see GUIDATA)
178
179 % Hints: get(hObject,'String') returns contents of edit_voice_threshold as text
180 % str2double(get(hObject,'String')) returns contents of edit_voice_threshold as a double
181 VSData = guidata(handles.VSHandle);
182 val = str2double(get(hObject, 'String'));
183
184 if (~isnan(val) && val >= 0)
185 VSData.vars.F0PraatVoiceThreshold = val;
186 guidata(handles.VSHandle, VSData);
187 set(hObject, 'String', num2str(val));
188 else
189 set(hObject, 'String', num2str(VSData.vars.F0PraatVoiceThreshold));
190 end
191
192
193 % --- Executes during object creation, after setting all properties.
194 function edit_voice_threshold_CreateFcn(hObject, eventdata, handles)
195 % hObject handle to edit_voice_threshold (see GCBO)
196 % eventdata reserved - to be defined in a future version of MATLAB
197 % handles empty - handles not created until after all CreateFcns called
198
199 % Hint: edit controls usually have a white background on Windows.
200 % See ISPC and COMPUTER.
201 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
202 set(hObject,'BackgroundColor','white');
203 end
204
205
206
207 function edit_oct_j_cost_Callback(hObject, eventdata, handles)
208 % hObject handle to edit_oct_j_cost (see GCBO)
209 % eventdata reserved - to be defined in a future version of MATLAB
210 % handles structure with handles and user data (see GUIDATA)
211
212 % Hints: get(hObject,'String') returns contents of edit_oct_j_cost as text
213 % str2double(get(hObject,'String')) returns contents of edit_oct_j_cost as a double
214 VSData = guidata(handles.VSHandle);
215 val = str2double(get(hObject, 'String'));
216
217 if (~isnan(val) && val >= 0)
218 VSData.vars.F0PraatOctiveJumpCost = val;
219 guidata(handles.VSHandle, VSData);
220 set(hObject, 'String', num2str(val));
221 else
222 set(hObject, 'String', num2str(VSData.vars.F0PraatOctiveJumpCost));
223 end
224
225
226 % --- Executes during object creation, after setting all properties.
227 function edit_oct_j_cost_CreateFcn(hObject, eventdata, handles)
228 % hObject handle to edit_oct_j_cost (see GCBO)
229 % eventdata reserved - to be defined in a future version of MATLAB
230 % handles empty - handles not created until after all CreateFcns called
231
232 % Hint: edit controls usually have a white background on Windows.
233 % See ISPC and COMPUTER.
234 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
235 set(hObject,'BackgroundColor','white');
236 end
237
238
239 % --- Executes on button press in pushbutton_OK.
240 function pushbutton_OK_Callback(hObject, eventdata, handles)
241 % hObject handle to pushbutton_OK (see GCBO)
242 % eventdata reserved - to be defined in a future version of MATLAB
243 % handles structure with handles and user data (see GUIDATA)
244
245 delete(gcf);
246
247
248 % --- Executes on button press in checkbox_kill_octave_jumps.
249 function checkbox_kill_octave_jumps_Callback(hObject, eventdata, handles)
250 % hObject handle to checkbox_kill_octave_jumps (see GCBO)
251 % eventdata reserved - to be defined in a future version of MATLAB
252 % handles structure with handles and user data (see GUIDATA)
253
254 % Hint: get(hObject,'Value') returns toggle state of checkbox_kill_octave_jumps
255 VSData = guidata(handles.VSHandle);
256 VSData.vars.F0PraatKillOctaveJumps = get(hObject, 'Value');
257 guidata(handles.VSHandle, VSData);
258
259
260 % --- Executes on button press in checkbox_smooth.
261 function checkbox_smooth_Callback(hObject, eventdata, handles)
262 % hObject handle to checkbox_smooth (see GCBO)
263 % eventdata reserved - to be defined in a future version of MATLAB
264 % handles structure with handles and user data (see GUIDATA)
265
266 % Hint: get(hObject,'Value') returns toggle state of checkbox_smooth
267 VSData = guidata(handles.VSHandle);
268 VSData.vars.F0PraatSmooth = get(hObject, 'Value');
269 guidata(handles.VSHandle, VSData);
270
271
272 % --- Executes on button press in checkbox_interpolate.
273 function checkbox_interpolate_Callback(hObject, eventdata, handles)
274 % hObject handle to checkbox_interpolate (see GCBO)
275 % eventdata reserved - to be defined in a future version of MATLAB
276 % handles structure with handles and user data (see GUIDATA)
277
278 % Hint: get(hObject,'Value') returns toggle state of checkbox_interpolate
279 VSData = guidata(handles.VSHandle);
280 VSData.vars.F0PraatInterpolate = get(hObject, 'Value');
281 guidata(handles.VSHandle, VSData);
282
283
284
285 function edit_silence_threshold_Callback(hObject, eventdata, handles)
286 % hObject handle to edit_silence_threshold (see GCBO)
287 % eventdata reserved - to be defined in a future version of MATLAB
288 % handles structure with handles and user data (see GUIDATA)
289
290 % Hints: get(hObject,'String') returns contents of edit_silence_threshold as text
291 % str2double(get(hObject,'String')) returns contents of edit_silence_threshold as a double
292 VSData = guidata(handles.VSHandle);
293 val = str2double(get(hObject, 'String'));
294
295 if (~isnan(val) && val >= 0)
296 VSData.vars.F0PraatSilenceThreshold = val;
297 guidata(handles.VSHandle, VSData);
298 set(hObject, 'String', num2str(val));
299 else
300 set(hObject, 'String', num2str(VSData.vars.F0PraatSilenceThreshold));
301 end
302
303
304 % --- Executes during object creation, after setting all properties.
305 function edit_silence_threshold_CreateFcn(hObject, eventdata, handles)
306 % hObject handle to edit_silence_threshold (see GCBO)
307 % eventdata reserved - to be defined in a future version of MATLAB
308 % handles empty - handles not created until after all CreateFcns called
309
310 % Hint: edit controls usually have a white background on Windows.
311 % See ISPC and COMPUTER.
312 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
313 set(hObject,'BackgroundColor','white');
314 end
315
316
317
318 function edit_octave_cost_Callback(hObject, eventdata, handles)
319 % hObject handle to edit_octave_cost (see GCBO)
320 % eventdata reserved - to be defined in a future version of MATLAB
321 % handles structure with handles and user data (see GUIDATA)
322
323 % Hints: get(hObject,'String') returns contents of edit_octave_cost as text
324 % str2double(get(hObject,'String')) returns contents of edit_octave_cost as a double
325 VSData = guidata(handles.VSHandle);
326 val = str2double(get(hObject, 'String'));
327
328 if (~isnan(val) && val >= 0)
329 VSData.vars.F0PraatOctaveCost = val;
330 guidata(handles.VSHandle, VSData);
331 set(hObject, 'String', num2str(val));
332 else
333 set(hObject, 'String', num2str(VSData.vars.F0PraatOctaveCost));
334 end
335
336
337 % --- Executes during object creation, after setting all properties.
338 function edit_octave_cost_CreateFcn(hObject, eventdata, handles)
339 % hObject handle to edit_octave_cost (see GCBO)
340 % eventdata reserved - to be defined in a future version of MATLAB
341 % handles empty - handles not created until after all CreateFcns called
342
343 % Hint: edit controls usually have a white background on Windows.
344 % See ISPC and COMPUTER.
345 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
346 set(hObject,'BackgroundColor','white');
347 end
348
349
350
351 function edit_voiced_unvoiced_cost_Callback(hObject, eventdata, handles)
352 % hObject handle to edit_voiced_unvoiced_cost (see GCBO)
353 % eventdata reserved - to be defined in a future version of MATLAB
354 % handles structure with handles and user data (see GUIDATA)
355
356 % Hints: get(hObject,'String') returns contents of edit_voiced_unvoiced_cost as text
357 % str2double(get(hObject,'String')) returns contents of edit_voiced_unvoiced_cost as a double
358 VSData = guidata(handles.VSHandle);
359 val = str2double(get(hObject, 'String'));
360
361 if (~isnan(val) && val >= 0)
362 VSData.vars.F0PraatVoicedUnvoicedCost = val;
363 guidata(handles.VSHandle, VSData);
364 set(hObject, 'String', num2str(val));
365 else
366 set(hObject, 'String', num2str(VSData.vars.F0PraatVoicedUnvoicedCost));
367 end
368
369
370 % --- Executes during object creation, after setting all properties.
371 function edit_voiced_unvoiced_cost_CreateFcn(hObject, eventdata, handles)
372 % hObject handle to edit_voiced_unvoiced_cost (see GCBO)
373 % eventdata reserved - to be defined in a future version of MATLAB
374 % handles empty - handles not created until after all CreateFcns called
375
376 % Hint: edit controls usually have a white background on Windows.
377 % See ISPC and COMPUTER.
378 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
379 set(hObject,'BackgroundColor','white');
380 end
381
382
383
384 function edit_smoothing_bandwidth_Callback(hObject, eventdata, handles)
385 % hObject handle to edit_smoothing_bandwidth (see GCBO)
386 % eventdata reserved - to be defined in a future version of MATLAB
387 % handles structure with handles and user data (see GUIDATA)
388
389 % Hints: get(hObject,'String') returns contents of edit_smoothing_bandwidth as text
390 % str2double(get(hObject,'String')) returns contents of edit_smoothing_bandwidth as a double
391 VSData = guidata(handles.VSHandle);
392 val = str2double(get(hObject, 'String'));
393
394 if (~isnan(val) && val >= 0)
395 VSData.vars.F0PraatSmoothingBandwidth = val;
396 guidata(handles.VSHandle, VSData);
397 set(hObject, 'String', num2str(val));
398 else
399 set(hObject, 'String', num2str(VSData.vars.F0PraatSmoothingBandwidth));
400 end
401
402
403 % --- Executes during object creation, after setting all properties.
404 function edit_smoothing_bandwidth_CreateFcn(hObject, eventdata, handles)
405 % hObject handle to edit_smoothing_bandwidth (see GCBO)
406 % eventdata reserved - to be defined in a future version of MATLAB
407 % handles empty - handles not created until after all CreateFcns called
408
409 % Hint: edit controls usually have a white background on Windows.
410 % See ISPC and COMPUTER.
411 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
412 set(hObject,'BackgroundColor','white');
413 end