LCOHERE implement coherence estimation computed on a log frequency axis. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LCOHERE implement coherence estimation computed on a log frequency axis. Usage: >> tfs = lcohere(as) >> tfs = lcohere(as, pl) Inputs: as - array of analysis objects pl - parameter list (see below) Outputs: bs - array of analysis objects, one for each input Parameter list: Kdes - desired number of averages [default: 100] Lmin - minimum segment length [default: 0] Jdes - number of spectral frequencies to compute [default: fs/4] Win - a specwin window object Only the design parameters of the window object are used; the window is recomputed for each DFT length inside the ltpda_dft algorithm. [default: Kaiser with -200dB PSLL] Olap - desired overlap [default: taken from window] Order - order of detrending. -1 - no detrending 0 - subtract mean 1 - subtract linear fit N - subtract fit of polynomial, order N M-FILE INFO: Get information about this methods by calling >> ao.getInfo('lcohere') Get information about a specified set-plist by calling: >> ao.getInfo('lcohere', 'None') VERSION: $Id: lcohere.m,v 1.7 2008/09/05 11:05:29 ingo Exp $ HISTORY: M Hewitson 02-02-07 Created %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % LCOHERE implement coherence estimation computed on a log frequency axis. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % LCOHERE implement coherence estimation computed on a 0005 % log frequency axis. 0006 % 0007 % Usage: 0008 % >> tfs = lcohere(as) 0009 % >> tfs = lcohere(as, pl) 0010 % 0011 % Inputs: 0012 % as - array of analysis objects 0013 % pl - parameter list (see below) 0014 % 0015 % Outputs: 0016 % bs - array of analysis objects, one for each input 0017 % 0018 % Parameter list: 0019 % Kdes - desired number of averages [default: 100] 0020 % Lmin - minimum segment length [default: 0] 0021 % Jdes - number of spectral frequencies to compute [default: fs/4] 0022 % Win - a specwin window object 0023 % Only the design parameters of the window object are used; the 0024 % window is recomputed for each DFT length inside the ltpda_dft 0025 % algorithm. [default: Kaiser with -200dB PSLL] 0026 % Olap - desired overlap [default: taken from window] 0027 % Order - order of detrending. 0028 % -1 - no detrending 0029 % 0 - subtract mean 0030 % 1 - subtract linear fit 0031 % N - subtract fit of polynomial, order N 0032 % 0033 % M-FILE INFO: Get information about this methods by calling 0034 % >> ao.getInfo('lcohere') 0035 % 0036 % Get information about a specified set-plist by calling: 0037 % >> ao.getInfo('lcohere', 'None') 0038 % 0039 % VERSION: $Id: lcohere.m,v 1.7 2008/09/05 11:05:29 ingo Exp $ 0040 % 0041 % HISTORY: M Hewitson 02-02-07 0042 % Created 0043 % 0044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0045 0046 function varargout = lcohere(varargin) 0047 0048 % Check if this is a call for parameters 0049 if utils.helper.isinfocall(varargin{:}) 0050 varargout{1} = getInfo(varargin{3}); 0051 return 0052 end 0053 0054 import utils.const.* 0055 utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename); 0056 0057 % Collect input variable names 0058 in_names = cell(size(varargin)); 0059 for ii = 1:nargin,in_names{ii} = inputname(ii);end 0060 0061 % Collect all AOs and plists 0062 [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names); 0063 pl = utils.helper.collect_objects(varargin(:), 'plist', in_names); 0064 0065 % Combine plists 0066 pl = combine(pl, getDefaultPlist); 0067 0068 % Compute coherence with lxspec 0069 varargout{1} = ao.lxspec(as, pl, 'cohere', getInfo, ao_invars); 0070 0071 end 0072 0073 %-------------------------------------------------------------------------- 0074 % Get Info Object 0075 %-------------------------------------------------------------------------- 0076 function ii = getInfo(varargin) 0077 if nargin == 1 && strcmpi(varargin{1}, 'None') 0078 sets = {}; 0079 pl = []; 0080 else 0081 sets = {'Default'}; 0082 pl = getDefaultPlist; 0083 end 0084 % Build info object 0085 ii = minfo(mfilename, 'ao', '', utils.const.categories.sigproc, '$Id: lcohere.m,v 1.7 2008/09/05 11:05:29 ingo Exp $', sets, pl); 0086 end 0087 0088 %-------------------------------------------------------------------------- 0089 % Get Default Plist 0090 %-------------------------------------------------------------------------- 0091 function pl = getDefaultPlist() 0092 pl = plist('Kdes', 100, 'Jdes', 1000, 'Lmin', 0,... 0093 'Win', getappdata(0, 'ltpda_default_spectral_window'), ... 0094 'Olap', -1, 'Order', 0); 0095 end 0096