123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/REC-html40/loose.dtd">
- <html>
- <head>
- <title>Description of chronux</title>
- <meta name="keywords" content="chronux">
- <meta name="description" content="This library performs time-frequency analysis (mostly using the">
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="generator" content="m2html © 2005 Guillaume Flandin">
- <meta name="robots" content="index, follow">
- <link type="text/css" rel="stylesheet" href="../../m2html.css">
- <script type="text/javascript">
- if (top.frames.length == 0) { top.location = "../../index.html"; };
- </script>
- </head>
- <body>
- <a name="_top"></a>
- <!-- ../menu.html chronux_2_10 --><!-- menu.html spectral_analysis -->
- <h1>chronux
- </h1>
- <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
- <div class="box"><strong>This library performs time-frequency analysis (mostly using the</strong></div>
- <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
- <div class="box"><strong>function chronux </strong></div>
- <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
- <div class="fragment"><pre class="comment"> This library performs time-frequency analysis (mostly using the
- multi-taper spectral estimation method) of univariate and multivariate
- data, both for continuous processes such as LFP/EEG and for point
- processes such as spike times. Point process can either be stored as
- times or as a binned process of counts. The routines in this library
- are named differently for the three cases. For calculations
- that can be performed for each of the three data types, we use suffixes
- c, pb, or pt to refer to continuous, point process binned counts, or
- point process times. For example, the spectrum calculation is performed
- mtspectrumc for continuous processes, mtspectrumpb for a binned point
- process, and mtspectrumpt for a point process consisting of times. There
- are also routines for calculating hybrid quantities involving one continuous
- and one point process. These are suffixed in a similar manner. For
- example, coherencycpb calculates the coherency between a binned point process
- and a continuous process.
-
- Certain variables are used repeatedly in this library.
- DATA
- data in most cases can be univariate or multivariate, and either point process,
- or continuous.
- Continuous data: Continuous data is assumed to be a matrix with
- dimensions samples x channels/trials.
- Point Process: A single time series of spike times can be in the form of
- a column vector.
- Multichannel/trial spike time data is not amenable to this
- storage format, since there are generally different
- number of spikes in each channel/trial. Instead,
- multichannel/trial spike data is stored in a structure
- array. A structure is a matlab data object with various
- fields. These fields contain the elements
- e.g. The command data=struct('times',[]); creates an empty
- structure with field 'times'. Similarly, the command
- data=struct('times',[1 2 3]); creates the structure with
- the field 'times' containing integers 1, 2, and 3.
-
- We can also have a structure array (or an array of structures)
- defined for example, by
- data(1)=struct('times',rand(1,100)); and
- data(2)=struct('times',rand(1,200));
- This is a 2 dimensional structure array where the
- first field is a 100 dimensional random vector, and
- the second field is a 200 dimensional random vector.
- This format allows storage of multichannel point
- process times in a single variable data.
-
- The above holds for point processes stored as times.
- If instead, the point processes are binned, then one
- can use a matrix to represent them
-
- Summary: data - array of continuous data with dimensions time x channels
- structural array of spike times with dimensions
- equal to the number of channels
- 1d array of spike times as a column vector
- array of binned spike counts with dimensions time x channels
- PARAMETERS:
- These are various parameters used in the spectral calculations. Since
- these parameters are used by most routines in Chronux, they are stored in
- a single structure params. The fields of params are
- tapers : precalculated tapers from dpss or in the one of the following
- forms:
- (1) A numeric vector [TW K] where TW is the
- time-bandwidth product and K is the number of
- tapers to be used (less than or equal to
- 2TW-1).
- (2) A numeric vector [W T p] where W is the
- bandwidth, T is the duration of the data and p
- is an integer such that 2TW-p tapers are used. In
- this form there is no default i.e. to specify
- the bandwidth, you have to specify T and p as
- well. Note that the units of W and T have to be
- consistent: if W is in Hz, T must be in seconds
- and vice versa. Note that these units must also
- be consistent with the units of params.Fs: W can
- be in Hz if and only if params.Fs is in Hz.
- The default is to use form 1 with TW=3 and K=5
- pad: (padding factor for the FFT) - optional (can take values -1,0,1,2...).
- -1 corresponds to no padding, 0 corresponds to padding
- to the next highest power of 2 etc.
- e.g. For N = 500, if PAD = -1, we do not pad; if PAD = 0, we pad the FFT
- to 512 points, if pad=1, we pad to 1024 points etc.
- Defaults to 0.
- Fs:sampling frequency.optional (default 1)
- fpass: frequencies in an fft calculation can range from 0 to Fs/2 where
- Fs is the sampling frequency. Sometimes it may be useful to
- compute fourier transforms (and resulting quantities like the
- spectrum over a smaller range of frequencies). This is specified
- by fpass, which can be in the form [fmin fmax] where fmin >=0 and
- fmax<=Fs/2. optional (default [0 Fs/2])
- err=[errtype p] calculates theoretical error bars (confidence levels)
- when errtype=1 and jackknife error bars when errchk=2. In each case, the
- error is calculated at a p value specified by p. -
- optional (default 0)
- trialave: trialave controls whether or not to average over channels/trials for
- multichannel/trial analyses. trialave=0 (default) implies no trial
- averaging, trialave=1 implies that the quantity of interest is averaged
- over channels/trials. optional (default 0)
-
- Other parameters are discussed in individual routines as and when they
- are used.</pre></div>
- <!-- crossreference -->
- <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
- This function calls:
- <ul style="list-style-image:url(../../matlabicon.gif)">
- </ul>
- This function is called by:
- <ul style="list-style-image:url(../../matlabicon.gif)">
- <li><a href="../../chronux_2_10/test/testAvg3.html" class="code" title="">testAvg3</a> This is a calling routine to test & check out the power spectrum &</li><li><a href="../../chronux_2_10/test/testAvg4.html" class="code" title="">testAvg4</a> This is a calling routine to test & check out the power spectrum &</li></ul>
- <!-- crossreference -->
- <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
- <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function chronux</a>
- 0002 <span class="comment">% This library performs time-frequency analysis (mostly using the</span>
- 0003 <span class="comment">% multi-taper spectral estimation method) of univariate and multivariate</span>
- 0004 <span class="comment">% data, both for continuous processes such as LFP/EEG and for point</span>
- 0005 <span class="comment">% processes such as spike times. Point process can either be stored as</span>
- 0006 <span class="comment">% times or as a binned process of counts. The routines in this library</span>
- 0007 <span class="comment">% are named differently for the three cases. For calculations</span>
- 0008 <span class="comment">% that can be performed for each of the three data types, we use suffixes</span>
- 0009 <span class="comment">% c, pb, or pt to refer to continuous, point process binned counts, or</span>
- 0010 <span class="comment">% point process times. For example, the spectrum calculation is performed</span>
- 0011 <span class="comment">% mtspectrumc for continuous processes, mtspectrumpb for a binned point</span>
- 0012 <span class="comment">% process, and mtspectrumpt for a point process consisting of times. There</span>
- 0013 <span class="comment">% are also routines for calculating hybrid quantities involving one continuous</span>
- 0014 <span class="comment">% and one point process. These are suffixed in a similar manner. For</span>
- 0015 <span class="comment">% example, coherencycpb calculates the coherency between a binned point process</span>
- 0016 <span class="comment">% and a continuous process.</span>
- 0017 <span class="comment">%</span>
- 0018 <span class="comment">% Certain variables are used repeatedly in this library.</span>
- 0019 <span class="comment">%</span>
- 0020 <span class="comment">% DATA</span>
- 0021 <span class="comment">% data in most cases can be univariate or multivariate, and either point process,</span>
- 0022 <span class="comment">% or continuous.</span>
- 0023 <span class="comment">%</span>
- 0024 <span class="comment">% Continuous data: Continuous data is assumed to be a matrix with</span>
- 0025 <span class="comment">% dimensions samples x channels/trials.</span>
- 0026 <span class="comment">%</span>
- 0027 <span class="comment">% Point Process: A single time series of spike times can be in the form of</span>
- 0028 <span class="comment">% a column vector.</span>
- 0029 <span class="comment">% Multichannel/trial spike time data is not amenable to this</span>
- 0030 <span class="comment">% storage format, since there are generally different</span>
- 0031 <span class="comment">% number of spikes in each channel/trial. Instead,</span>
- 0032 <span class="comment">% multichannel/trial spike data is stored in a structure</span>
- 0033 <span class="comment">% array. A structure is a matlab data object with various</span>
- 0034 <span class="comment">% fields. These fields contain the elements</span>
- 0035 <span class="comment">% e.g. The command data=struct('times',[]); creates an empty</span>
- 0036 <span class="comment">% structure with field 'times'. Similarly, the command</span>
- 0037 <span class="comment">% data=struct('times',[1 2 3]); creates the structure with</span>
- 0038 <span class="comment">% the field 'times' containing integers 1, 2, and 3.</span>
- 0039 <span class="comment">%</span>
- 0040 <span class="comment">% We can also have a structure array (or an array of structures)</span>
- 0041 <span class="comment">% defined for example, by</span>
- 0042 <span class="comment">% data(1)=struct('times',rand(1,100)); and</span>
- 0043 <span class="comment">% data(2)=struct('times',rand(1,200));</span>
- 0044 <span class="comment">% This is a 2 dimensional structure array where the</span>
- 0045 <span class="comment">% first field is a 100 dimensional random vector, and</span>
- 0046 <span class="comment">% the second field is a 200 dimensional random vector.</span>
- 0047 <span class="comment">% This format allows storage of multichannel point</span>
- 0048 <span class="comment">% process times in a single variable data.</span>
- 0049 <span class="comment">%</span>
- 0050 <span class="comment">% The above holds for point processes stored as times.</span>
- 0051 <span class="comment">% If instead, the point processes are binned, then one</span>
- 0052 <span class="comment">% can use a matrix to represent them</span>
- 0053 <span class="comment">%</span>
- 0054 <span class="comment">%</span>
- 0055 <span class="comment">% Summary: data - array of continuous data with dimensions time x channels</span>
- 0056 <span class="comment">% structural array of spike times with dimensions</span>
- 0057 <span class="comment">% equal to the number of channels</span>
- 0058 <span class="comment">% 1d array of spike times as a column vector</span>
- 0059 <span class="comment">% array of binned spike counts with dimensions time x channels</span>
- 0060 <span class="comment">%</span>
- 0061 <span class="comment">% PARAMETERS:</span>
- 0062 <span class="comment">% These are various parameters used in the spectral calculations. Since</span>
- 0063 <span class="comment">% these parameters are used by most routines in Chronux, they are stored in</span>
- 0064 <span class="comment">% a single structure params. The fields of params are</span>
- 0065 <span class="comment">%</span>
- 0066 <span class="comment">% tapers : precalculated tapers from dpss or in the one of the following</span>
- 0067 <span class="comment">% forms:</span>
- 0068 <span class="comment">% (1) A numeric vector [TW K] where TW is the</span>
- 0069 <span class="comment">% time-bandwidth product and K is the number of</span>
- 0070 <span class="comment">% tapers to be used (less than or equal to</span>
- 0071 <span class="comment">% 2TW-1).</span>
- 0072 <span class="comment">% (2) A numeric vector [W T p] where W is the</span>
- 0073 <span class="comment">% bandwidth, T is the duration of the data and p</span>
- 0074 <span class="comment">% is an integer such that 2TW-p tapers are used. In</span>
- 0075 <span class="comment">% this form there is no default i.e. to specify</span>
- 0076 <span class="comment">% the bandwidth, you have to specify T and p as</span>
- 0077 <span class="comment">% well. Note that the units of W and T have to be</span>
- 0078 <span class="comment">% consistent: if W is in Hz, T must be in seconds</span>
- 0079 <span class="comment">% and vice versa. Note that these units must also</span>
- 0080 <span class="comment">% be consistent with the units of params.Fs: W can</span>
- 0081 <span class="comment">% be in Hz if and only if params.Fs is in Hz.</span>
- 0082 <span class="comment">% The default is to use form 1 with TW=3 and K=5</span>
- 0083 <span class="comment">%</span>
- 0084 <span class="comment">%</span>
- 0085 <span class="comment">% pad: (padding factor for the FFT) - optional (can take values -1,0,1,2...).</span>
- 0086 <span class="comment">% -1 corresponds to no padding, 0 corresponds to padding</span>
- 0087 <span class="comment">% to the next highest power of 2 etc.</span>
- 0088 <span class="comment">% e.g. For N = 500, if PAD = -1, we do not pad; if PAD = 0, we pad the FFT</span>
- 0089 <span class="comment">% to 512 points, if pad=1, we pad to 1024 points etc.</span>
- 0090 <span class="comment">% Defaults to 0.</span>
- 0091 <span class="comment">%</span>
- 0092 <span class="comment">% Fs:sampling frequency.optional (default 1)</span>
- 0093 <span class="comment">%</span>
- 0094 <span class="comment">%</span>
- 0095 <span class="comment">% fpass: frequencies in an fft calculation can range from 0 to Fs/2 where</span>
- 0096 <span class="comment">% Fs is the sampling frequency. Sometimes it may be useful to</span>
- 0097 <span class="comment">% compute fourier transforms (and resulting quantities like the</span>
- 0098 <span class="comment">% spectrum over a smaller range of frequencies). This is specified</span>
- 0099 <span class="comment">% by fpass, which can be in the form [fmin fmax] where fmin >=0 and</span>
- 0100 <span class="comment">% fmax<=Fs/2. optional (default [0 Fs/2])</span>
- 0101 <span class="comment">%</span>
- 0102 <span class="comment">% err=[errtype p] calculates theoretical error bars (confidence levels)</span>
- 0103 <span class="comment">% when errtype=1 and jackknife error bars when errchk=2. In each case, the</span>
- 0104 <span class="comment">% error is calculated at a p value specified by p. -</span>
- 0105 <span class="comment">% optional (default 0)</span>
- 0106 <span class="comment">%</span>
- 0107 <span class="comment">% trialave: trialave controls whether or not to average over channels/trials for</span>
- 0108 <span class="comment">% multichannel/trial analyses. trialave=0 (default) implies no trial</span>
- 0109 <span class="comment">% averaging, trialave=1 implies that the quantity of interest is averaged</span>
- 0110 <span class="comment">% over channels/trials. optional (default 0)</span>
- 0111 <span class="comment">%</span>
- 0112 <span class="comment">% Other parameters are discussed in individual routines as and when they</span>
- 0113 <span class="comment">% are used.</span></pre></div>
- <hr><address>Generated on Fri 12-Aug-2011 11:36:15 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> © 2005</address>
- </body>
- </html>
|