Estimate mean amplitude by using histgram for outlier exclusion and calculate amplitude/mean ratio to find bad channel & trials amplitude/mean ratio using Median can be also calculated [ymax, med] = vb_get_max_med_ratio(X) X(t,n) : signal at time t & n-th trial [Tsampla x Ntrial] ymax(n) : amplitude/median ratio for each trial [1 x Ntrial] = max_t (abs(X(t,n))) med(n) : median of abs(X(:,n)) 2008-6-1 Masa-aki Sato Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [ymax, ymed] = vb_get_max_med_ratio(data) 0002 % Estimate mean amplitude by using histgram for outlier exclusion 0003 % and calculate amplitude/mean ratio to find bad channel & trials 0004 % amplitude/mean ratio using Median can be also calculated 0005 % [ymax, med] = vb_get_max_med_ratio(X) 0006 % X(t,n) : signal at time t & n-th trial [Tsampla x Ntrial] 0007 % ymax(n) : amplitude/median ratio for each trial [1 x Ntrial] 0008 % = max_t (abs(X(t,n))) 0009 % med(n) : median of abs(X(:,n)) 0010 % 0011 % 2008-6-1 Masa-aki Sato 0012 % 0013 % Copyright (C) 2011, ATR All Rights Reserved. 0014 % License : New BSD License(see VBMEG_LICENSE.txt) 0015 0016 yamp = abs(data); 0017 ymax = max(yamp,[],1); % [1 x Ntry] 0018 ymed = median(yamp,1); 0019 0020 return