LTPDA_COHERE makes coherence estimates of the time-series objects %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: LTPDA_COHERE makes coherence estimates of the time-series objects in the input analysis objects. Coherences are computed using MATLAB's mscohere (>> help mscohere). CALL: b = ltpda_cohere(a1,a2,a3,...,pl) INPUTS: b - output analysis objects aN - input analysis objects (at least two) pl - input parameter list The function makes coherence estimates between a1 and all other input AOs. Therefore, if the input argument list contains N analysis objects, the output, b, will contain N-1 coherence estimates. If the last input argument is a parameter list (plist) it is used. The following parameters are recognised. PARAMETERS: Win - a specwin window object [default: Kaiser -200dB psll] Nolap - segment overlap (number of samples) [default: taken from window function] Nfft - number of samples in each fft [default: half length of input data] Order - order of detrending. -1 - no detrending 0 - subtract mean [default] 1 - subtract linear fit N - subtract fit of polynomial, order N VERSION: $Id: ltpda_cohere.m,v 1.9 2007/10/05 11:36:19 hewitson Exp $ HISTORY: 07-02-2007 M Hewitson Creation The following call returns a parameter list object that contains the default parameter values: >> pl = ltpda_cohere('Params') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function varargout = ltpda_cohere(varargin) 0002 % LTPDA_COHERE makes coherence estimates of the time-series objects 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: LTPDA_COHERE makes coherence estimates of the time-series objects 0007 % in the input analysis objects. Coherences are computed using 0008 % MATLAB's mscohere (>> help mscohere). 0009 % 0010 % CALL: b = ltpda_cohere(a1,a2,a3,...,pl) 0011 % 0012 % INPUTS: b - output analysis objects 0013 % aN - input analysis objects (at least two) 0014 % pl - input parameter list 0015 % 0016 % The function makes coherence estimates between a1 and all other 0017 % input AOs. Therefore, if the input argument list contains N 0018 % analysis objects, the output, b, will contain N-1 coherence estimates. 0019 % 0020 % If the last input argument is a parameter list (plist) it is used. 0021 % The following parameters are recognised. 0022 % 0023 % PARAMETERS: Win - a specwin window object [default: Kaiser -200dB psll] 0024 % Nolap - segment overlap (number of samples) [default: taken from window function] 0025 % Nfft - number of samples in each fft [default: half length of input data] 0026 % Order - order of detrending. 0027 % -1 - no detrending 0028 % 0 - subtract mean [default] 0029 % 1 - subtract linear fit 0030 % N - subtract fit of polynomial, order N 0031 % 0032 % 0033 % VERSION: $Id: ltpda_cohere.m,v 1.9 2007/10/05 11:36:19 hewitson Exp $ 0034 % 0035 % HISTORY: 07-02-2007 M Hewitson 0036 % Creation 0037 % 0038 % The following call returns a parameter list object that contains the 0039 % default parameter values: 0040 % 0041 % >> pl = ltpda_cohere('Params') 0042 % 0043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0044 0045 ALGONAME = mfilename; 0046 VERSION = '$Id: ltpda_cohere.m,v 1.9 2007/10/05 11:36:19 hewitson Exp $'; 0047 0048 % Check if this is a call for parameters 0049 if nargin == 1 0050 in = char(varargin{1}); 0051 if strcmp(in, 'Params') 0052 varargout{1} = getDefaultPL(); 0053 return 0054 end 0055 end 0056 0057 % capture input variable names 0058 invars = {}; 0059 as = []; 0060 ps = []; 0061 for j=1:nargin 0062 if isa(varargin{j}, 'ao') 0063 as = [as varargin{j}]; 0064 % record the name of this ao 0065 invars = [invars cellstr(inputname(j))]; 0066 end 0067 if isa(varargin{j}, 'plist') 0068 ps = [ps varargin{j}]; 0069 end 0070 end 0071 0072 0073 % check plist 0074 if isempty(ps) 0075 pl = getDefaultPL(); 0076 else 0077 pl = combine(ps, getDefaultPL); 0078 end 0079 0080 varargout{1} = ltpda_xspec(as, pl, 'COHERE', ALGONAME, VERSION, invars); 0081 0082 0083 %-------------------------------------------------------------------------- 0084 % Get default params 0085 function plo = getDefaultPL() 0086 0087 disp('* creating default plist...'); 0088 plo = plist(); 0089 plo = append(plo, param('Nfft', -0.5)); 0090 plo = append(plo, param('Win', specwin('Kaiser', 1, 100))); 0091 plo = append(plo, param('Nolap', -1)); 0092 plo = append(plo, param('Order', 0)); 0093 0094 disp('* done.'); 0095 0096