


LTPDA_CPSD makes cross-spectral density estimates of the time-series objects.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: LTPDA_CPSD makes cross-spectral density estimates of the
time-series objects in the input analysis objects. CPSDs are computed
using MATLAB's cpsd (>> help cpsd).
CALL: b = ltpda_cpsd(a1,a2,a3,...,pl)
INPUTS: b - output analysis objects
aN - input analysis objects (at least two)
pl - input parameter list
The function makes CPSD estimates between a1 and all other input AOs.
Therefore, if the input argument list contains N analysis objects, the
output a will contain N-1 CPSD 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]
'Olap' - segment percent overlap [default: taken from window function]
'Nfft' - number of samples in each fft [default: fs of input data]
VERSION: $Id: ltpda_cpsd.html,v 1.13 2008/03/26 18:02:09 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_cpsd('Params')
The following call returns a string that contains the routine CVS version:
>> ver = ltpda_cpsd('Version')
The following call returns a string that contains the routine category:
>> category = ltpda_cpsd('Category')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


0001 function varargout = ltpda_cpsd(varargin) 0002 % LTPDA_CPSD makes cross-spectral density estimates of the time-series objects. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: LTPDA_CPSD makes cross-spectral density estimates of the 0007 % time-series objects in the input analysis objects. CPSDs are computed 0008 % using MATLAB's cpsd (>> help cpsd). 0009 % 0010 % CALL: b = ltpda_cpsd(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 CPSD estimates between a1 and all other input AOs. 0017 % Therefore, if the input argument list contains N analysis objects, the 0018 % output a will contain N-1 CPSD estimates. 0019 % 0020 % If the last input argument is a parameter list (plist) it is used. The 0021 % following parameters are recognised. 0022 % 0023 % PARAMETERS: 'Win' - a specwin window object [default: Kaiser -200dB psll] 0024 % 'Olap' - segment percent overlap [default: taken from window function] 0025 % 'Nfft' - number of samples in each fft [default: fs of input data] 0026 % 0027 % VERSION: $Id: ltpda_cpsd.html,v 1.13 2008/03/26 18:02:09 hewitson Exp $ 0028 % 0029 % HISTORY: 07-02-2007 M Hewitson 0030 % Creation 0031 % 0032 % The following call returns a parameter list object that contains the 0033 % default parameter values: 0034 % 0035 % >> pl = ltpda_cpsd('Params') 0036 % 0037 % The following call returns a string that contains the routine CVS version: 0038 % 0039 % >> ver = ltpda_cpsd('Version') 0040 % 0041 % The following call returns a string that contains the routine category: 0042 % 0043 % >> category = ltpda_cpsd('Category') 0044 % 0045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0046 0047 % 'Debug' - debug level for terminal output (0-1) 0048 0049 ALGONAME = mfilename; 0050 VERSION = '$Id: ltpda_cpsd.html,v 1.13 2008/03/26 18:02:09 hewitson Exp $'; 0051 CATEGORY = 'Signal Processing'; 0052 0053 0054 %% Check if this is a call for parameters, the CVS version string 0055 % or the function category 0056 if nargin == 1 && ischar(varargin{1}) 0057 in = char(varargin{1}); 0058 if strcmp(in, 'Params') 0059 varargout{1} = getDefaultPL(); 0060 return 0061 elseif strcmp(in, 'Version') 0062 varargout{1} = VERSION; 0063 return 0064 elseif strcmp(in, 'Category') 0065 varargout{1} = CATEGORY; 0066 return 0067 end 0068 end 0069 0070 % capture input variable names 0071 invars = {}; 0072 as = []; 0073 ps = []; 0074 for j=1:nargin 0075 invars = [invars cellstr(inputname(j))]; 0076 if isa(varargin{j}, 'ao') 0077 as = [as varargin{j}]; 0078 end 0079 if isa(varargin{j}, 'plist') 0080 ps = [ps varargin{j}]; 0081 end 0082 end 0083 0084 0085 % check plist 0086 if isempty(ps) 0087 pl = getDefaultPL(); 0088 else 0089 pl = combine(ps, getDefaultPL); 0090 end 0091 0092 varargout{1} = ltpda_xspec(as, pl, 'CPSD', ALGONAME, VERSION, invars); 0093 0094 0095 %-------------------------------------------------------------------------- 0096 % Get default params 0097 function plo = getDefaultPL() 0098 0099 disp('* creating default plist...'); 0100 0101 plo = plist('Nfft', -0.5, ... 0102 'Win', specwin('Kaiser', 1, 100), ... 0103 'Olap', -1); 0104 0105 disp('* done.'); 0106 0107