LTPDA_TFE makes transfer function estimates of the time-series objects in the input analysis objects. Transfer functions are computed using MATLAB's tfestimate (>> help tfestimate). Usage: b = ltpda_tfe(a1,a2,a3,...,pl) b - output analysis objects aN - input analysis objects (at least two) pl - input parameter list The output matrix b contains NxN transfer functions estimates (all possible pairs of input AOs). 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] M Hewitson 07-02-07
0001 function varargout = ltpda_tfe(varargin) 0002 0003 % LTPDA_TFE makes transfer function estimates of the time-series 0004 % objects in the input analysis objects. Transfer functions are computed 0005 % using MATLAB's tfestimate (>> help tfestimate). 0006 % 0007 % 0008 % Usage: b = ltpda_tfe(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 output matrix b contains NxN transfer functions estimates (all 0015 % possible pairs of input AOs). 0016 % 0017 % If the last input argument is a parameter list (plist) it is used. The 0018 % following parameters are recognised. 0019 % 0020 % Parameters: 0021 % 'Win' - a specwin window object [default: Kaiser -200dB psll] 0022 % 'Nolap' - segment overlap (number of samples) [default: taken from window function] 0023 % 'Nfft' - number of samples in each fft [default: fs of input data] 0024 % 0025 % M Hewitson 07-02-07 0026 % 0027 0028 ALGONAME = mfilename; 0029 VERSION = '$Id: ltpda_tfe.html,v 1.1 2007/06/08 14:15:11 hewitson Exp $'; 0030 0031 % Check if this is a call for parameters 0032 if nargin == 1 0033 in = char(varargin{1}); 0034 if strcmp(in, 'Params') 0035 varargout{1} = getDefaultPL(); 0036 return 0037 end 0038 end 0039 0040 % capture input variable names 0041 invars = {}; 0042 as = []; 0043 ps = []; 0044 for j=1:nargin 0045 invars = [invars cellstr(inputname(j))]; 0046 if isa(varargin{j}, 'ao') 0047 as = [as varargin{j}]; 0048 end 0049 if isa(varargin{j}, 'plist') 0050 ps = [ps varargin{j}]; 0051 end 0052 end 0053 0054 0055 % check plist 0056 if isempty(ps) 0057 pl = getDefaultPL(); 0058 else 0059 pl = combine(ps, getDefaultPL); 0060 end 0061 0062 varargout{1} = ltpda_xspec(as, pl, 'TF', ALGONAME, VERSION, invars); 0063 0064 0065 0066 0067 0068 %-------------------------------------------------------------------------- 0069 % Get default params 0070 function plo = getDefaultPL() 0071 0072 disp('* creating default plist...'); 0073 plo = plist(); 0074 plo = append(plo, param('Nfft', -1)); 0075 plo = append(plo, param('Win', specwin('Kaiser', 1, 100))); 0076 plo = append(plo, param('Nolap', -1)); 0077 disp('* done.'); 0078