


LTPDA_COHERE makes coherence estimates of the time-series
objects in the input analysis objects. Coherences are computed
using MATLAB's mscohere (>> help mscohere).
Usage: b = ltpda_cohere(a1,a2,a3,...,pl)
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: fs of input data]
The following call returns a parameter list object that contains the
default parameter values:
>> pl = ltpda_cohere('Params')
M Hewitson 07-02-07


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