dpsschk

PURPOSE ^

Helper function to calculate tapers and, if precalculated tapers are supplied,

SYNOPSIS ^

function tapers=dpsschk(tapers,N)

DESCRIPTION ^

 Helper function to calculate tapers and, if precalculated tapers are supplied, 
 to check that they (the precalculated tapers) the same length in time as
 the time series being studied. The length of the time series is specified
 as the second input argument N. Thus if precalculated tapers have
 dimensions [N1 K], we require that N1=N.
 Usage: tapers=dpsschk(tapers,N)
 Inputs:
 tapers        (tapers in the form of: 
                                   (i) precalculated tapers or,
                                   (ii) [NW K] - time-bandwidth product, number of tapers) 
 N             (number of samples)
 Outputs: 
 tapers        (calculated or precalculated tapers)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function tapers=dpsschk(tapers,N)
0002 % Helper function to calculate tapers and, if precalculated tapers are supplied,
0003 % to check that they (the precalculated tapers) the same length in time as
0004 % the time series being studied. The length of the time series is specified
0005 % as the second input argument N. Thus if precalculated tapers have
0006 % dimensions [N1 K], we require that N1=N.
0007 % Usage: tapers=dpsschk(tapers,N)
0008 % Inputs:
0009 % tapers        (tapers in the form of:
0010 %                                   (i) precalculated tapers or,
0011 %                                   (ii) [NW K] - time-bandwidth product, number of tapers)
0012 % N             (number of samples)
0013 % Outputs:
0014 % tapers        (calculated or precalculated tapers)
0015 if nargin < 2; error('Need all arguments'); end
0016 sz=size(tapers);
0017 if sz(1)==1 & sz(2)==2;
0018     tapers=dpss(N,tapers(1),tapers(2));
0019 elseif N~=sz(1);
0020     error('seems to be an error in your dpss calculation; the number of time points is different from the length of the tapers');
0021 end;

Generated on Tue 24-Aug-2004 15:55:33 by m2html © 2003