LCPSD implement cross-power-spectral density estimation computed on a log frequency axis. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LCPSD implement cross-power-spectral density estimation computed on a log frequency axis. Usage: >> tfs = lcpsd(as) >> tfs = lcpsd(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('lcpsd') Get information about a specified set-plist by calling: >> ao.getInfo('lcpsd', 'None') VERSION: $Id: lcpsd.m,v 1.7 2008/09/05 11:05:29 ingo Exp $ HISTORY: M Hewitson 02-02-07 Created %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % LCPSD implement cross-power-spectral density estimation computed on a log frequency axis. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % LCPSD implement cross-power-spectral density estimation computed on a 0005 % log frequency axis. 0006 % 0007 % Usage: 0008 % >> tfs = lcpsd(as) 0009 % >> tfs = lcpsd(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('lcpsd') 0035 % 0036 % Get information about a specified set-plist by calling: 0037 % >> ao.getInfo('lcpsd', 'None') 0038 % 0039 % VERSION: $Id: lcpsd.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 = lcpsd(varargin) 0047 0048 %%% Check if this is a call for parameters 0049 if nargin == 3 && ischar(varargin{2}) && ischar(varargin{3}) && strcmp(varargin{2}, 'INFO') 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, pl_invars] = 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, 'cpsd', getInfo, ao_invars); 0070 end 0071 0072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0073 % 0074 % FUNCTION: getInfo 0075 % 0076 % DESCRIPTION: Get Info Object 0077 % 0078 % HISTORY: 11-07-07 M Hewitson 0079 % Creation. 0080 % 0081 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0082 0083 function ii = getInfo(varargin) 0084 if nargin == 1 && strcmpi(varargin{1}, 'None') 0085 sets = {}; 0086 pl = []; 0087 else 0088 sets = {'Default'}; 0089 pl = getDefaultPlist(); 0090 end 0091 % Build info object 0092 ii = minfo(mfilename, 'ao', '', utils.const.categories.sigproc, '$Id: lcpsd.m,v 1.7 2008/09/05 11:05:29 ingo Exp $', sets, pl); 0093 end 0094 0095 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0096 % 0097 % FUNCTION: getDefaultPlist 0098 % 0099 % DESCRIPTION: Get Default Plist 0100 % 0101 % HISTORY: 11-07-07 M Hewitson 0102 % Creation. 0103 % 0104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0105 0106 function plo = getDefaultPlist() 0107 plo = plist('Kdes', 100, 'Jdes', 1000, 'Lmin', 0,... 0108 'Win', getappdata(0, 'ltpda_default_spectral_window'), ... 0109 'Olap', -1, 'Order', 0); 0110 0111 end 0112 0113 0114 0115 0116