TKE operator EMG filter z = vb_emg_filter(x,fsamp) 1. band-pass filtering at 30-300 Hz (6th order Butterworth) 2. y(t) = x(t)^2 - x(t-1)x(t+1) (TKE operator) 3. low-pass filtering at 50 Hz (2nd order Butterworth) - Solnik S, Rider P, Steinweg K, DeVita P, and Hortobagyi T. Teager-Kaiser energy operator signal conditioning improves EMG onset detection Eur J Appl Physiol 110: 489-498, 2010. Masa-aki Sato 2012-2-18 Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function z = vb_emg_filter(x,fsamp) 0002 % TKE operator EMG filter 0003 % z = vb_emg_filter(x,fsamp) 0004 % 0005 % 1. band-pass filtering at 30-300 Hz (6th order Butterworth) 0006 % 2. y(t) = x(t)^2 - x(t-1)x(t+1) (TKE operator) 0007 % 3. low-pass filtering at 50 Hz (2nd order Butterworth) 0008 % 0009 % - Solnik S, Rider P, Steinweg K, DeVita P, and Hortobagyi T. 0010 % Teager-Kaiser energy operator signal conditioning 0011 % improves EMG onset detection 0012 % Eur J Appl Physiol 110: 489-498, 2010. 0013 % 0014 % Masa-aki Sato 2012-2-18 0015 % 0016 % Copyright (C) 2011, ATR All Rights Reserved. 0017 % License : New BSD License(see VBMEG_LICENSE.txt) 0018 0019 % 1. band-pass filtering at 30-300 Hz (6th order Butterworth) 0020 if fsamp <= 250, 0021 fcut = [30 ]; 0022 ftype = 'high'; 0023 else 0024 fcut = [30 300]; 0025 ftype = 'bandpass'; 0026 end 0027 0028 Norder = 6; 0029 [B,A] = butter(Norder, fcut/(fsamp/2) ,ftype); 0030 0031 y = filtfilt(B,A, x ); 0032 0033 y = y(:); 0034 T = length(y); 0035 0036 % 2. y(t) = x(t)^2 - x(t-1)x(t+1) (TKEO) 0037 z = y.^2 - [y(1); y(1:T-1)].*[y(2:T); y(T)]; 0038 z = abs(z); 0039 0040 % 3. low-pass filtering at 50 Hz (2nd order Butterworth) 0041 fcut = 50; 0042 Norder = 2; 0043 [B,A] = butter(Norder, fcut/(fsamp/2) ,'low'); 0044 0045 z = filtfilt(B,A, z );