Create voice trigger. [USAGE] vb_voice_trigger_new(ch_name, status_level, t_period, p_val, t_smooth); [IN] ch_name : extract trigger from this channel [string] status_level : factor for amplitude threshold. <optional> t_period : <optional> p_val : <optional> t_smooth : <optional> [OUT] obj : voice_trigger object [see also] vb_get_voise_onset Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [obj] = vb_voice_trigger_new(ch_name, ... 0002 status_level, t_period, ... 0003 p_val, t_smooth) 0004 % Create voice trigger. 0005 % 0006 % [USAGE] 0007 % vb_voice_trigger_new(ch_name, status_level, t_period, p_val, t_smooth); 0008 % [IN] 0009 % ch_name : extract trigger from this channel [string] 0010 % status_level : factor for amplitude threshold. <optional> 0011 % t_period : <optional> 0012 % p_val : <optional> 0013 % t_smooth : <optional> 0014 % [OUT] 0015 % obj : voice_trigger object 0016 % [see also] 0017 % vb_get_voise_onset 0018 % 0019 % Copyright (C) 2011, ATR All Rights Reserved. 0020 % License : New BSD License(see VBMEG_LICENSE.txt) 0021 0022 % 0023 % --- Previous check 0024 % 0025 if nargin < 1 0026 error('This function needs 1 argments. Please check your code.'); 0027 end 0028 0029 % 0030 % --- Main Procedure 0031 % 0032 if ~exist('status_level', 'var') 0033 status_level = []; 0034 end 0035 obj = vb_trigger_new(ch_name, 'voice', status_level); 0036 0037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0038 % PARAMETER NAME IS IMPORTANT(for vb_get_trial_index) 0039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0040 if exist('t_period', 'var') 0041 obj.t_period = t_period; 0042 end 0043 if exist('p_val', 'var') 0044 obj.p_val = p_val; 0045 end 0046 if exist('t_smooth', 'var') 0047 obj.t_smooth = t_smooth; 0048 end 0049 0050 % 0051 % --- After check 0052 % 0053 if nargout < 1 0054 error('function caller should receive this object.'); 0055 end