Find EMG onset time using smoothed EMG signal [ix ,zd, z] = vb_get_emg_onset(y, parm) [ix ,zd, z, ix_y, yd, ix_z, ix_s] = vb_get_emg_onset(y, parm) --- Input y : EMG signal parm : parameter structure parm.fsamp : sampling frequency [Hz] --- Optional parameter for EMG onset parm.t_event : minimum distance from previous onset event [500 ms] --- Usually following parameters need not be changed parm.t_smooth : moving average window length [10 ms] parm.t_period : minimum period that Smoothed EMG > threshold [50 ms] parm.p_val : P-value corresponding to the threshold for [smooth(EMG)] = [0.001] --- Condition for EMG onset 1. Smoothed EMG (yave) should exceed 'z0' more than 't_period' length 2. Distance from previous onset should be larger than 't_event' --- Output ix : extracted onset time index zd : smoothed EMG threshold value z : smoothed EMG by moving average ix_y : abs(EMG) onset time index yd : threshold for abs(y) ix_z : smoothed EMG onset ix_s : start & end of slope estimation region at jx 2009-09-05 Masa-aki Sato 2012-2-18 Masa-aki Sato Use TKE operator EMG filter 2012-2-22 Masa-aki Sato threshold determination is changed Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [ix ,zd, z, ix_y, yd, ix_z, ix_s] = vb_get_emg_onset(y,parm) 0002 % Find EMG onset time using smoothed EMG signal 0003 % [ix ,zd, z] = vb_get_emg_onset(y, parm) 0004 % [ix ,zd, z, ix_y, yd, ix_z, ix_s] = vb_get_emg_onset(y, parm) 0005 % --- Input 0006 % y : EMG signal 0007 % parm : parameter structure 0008 % parm.fsamp : sampling frequency [Hz] 0009 % --- Optional parameter for EMG onset 0010 % parm.t_event : minimum distance from previous onset event [500 ms] 0011 % --- Usually following parameters need not be changed 0012 % parm.t_smooth : moving average window length [10 ms] 0013 % parm.t_period : minimum period that Smoothed EMG > threshold [50 ms] 0014 % parm.p_val : P-value corresponding to the threshold for [smooth(EMG)] 0015 % = [0.001] 0016 % --- Condition for EMG onset 0017 % 1. Smoothed EMG (yave) should exceed 'z0' more than 't_period' length 0018 % 2. Distance from previous onset should be larger than 't_event' 0019 % 0020 % --- Output 0021 % ix : extracted onset time index 0022 % zd : smoothed EMG threshold value 0023 % z : smoothed EMG by moving average 0024 % ix_y : abs(EMG) onset time index 0025 % yd : threshold for abs(y) 0026 % ix_z : smoothed EMG onset 0027 % ix_s : start & end of slope estimation region at jx 0028 % 0029 % 2009-09-05 Masa-aki Sato 0030 % 2012-2-18 Masa-aki Sato 0031 % Use TKE operator EMG filter 0032 % 2012-2-22 Masa-aki Sato 0033 % threshold determination is changed 0034 % 0035 % Copyright (C) 2011, ATR All Rights Reserved. 0036 % License : New BSD License(see VBMEG_LICENSE.txt) 0037 0038 [yd, zd, z] = vb_get_emg_threshold(y, parm); 0039 0040 if isempty(parm.status_level) 0041 zd = yd; 0042 else 0043 zd = yd * parm.status_level; 0044 end 0045 0046 [ix ,ix_y, ix_z, ix_s] = vb_get_emg_onset_time(y , z ,yd, zd, parm); 0047 0048 %[ix] = vb_emg_spectral_check(y,ix,parm); 0049 0050 0051 return