Home > chronux_code > exploratory > correlations > pointtimes > corr_logspecpt.m

corr_logspecpt

PURPOSE ^

Correlations in the multi-taper log spectrum for a single time series -

SYNOPSIS ^

function C=corr_logspecpt(data,win,tapers,pad,Fs,fpass)

DESCRIPTION ^

 Correlations in the multi-taper log spectrum for a single time series -
 point process times

 Usage:

 C=corr_logspept(data,win,tapers,pad,Fs,fpass)
 Input: 
 Note units have to be consistent. See chronux.m for more information.
       data (structure array of one channel of spike times; also accepts 1d column vector of spike times) -- required
       win  (duration of the segments) - required. 
       tapers (precalculated tapers from dpss, or in the form [NW K] e.g [3 5]) -- optional. If not 
                                                 specified, use [NW K]=[3 5]
        pad            (padding factor for the FFT) - optional. Defaults to 0.  
                       e.g. For N = 500, if PAD = 0, we pad the FFT 
                       to 512 points; if PAD = 2, we pad the FFT
                       to 2048 points, etc.
       Fs   (sampling frequency) - optional. Default 1.
       fpass    (frequency band to be used in the calculation in the form
                                   [fmin fmax])- optional. 
                                   Default all frequencies between 0 and Fs/2
 Output:
       C       (correlations in the log spectrum at two different frequencies)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function C=corr_logspecpt(data,win,tapers,pad,Fs,fpass)
0002 % Correlations in the multi-taper log spectrum for a single time series -
0003 % point process times
0004 %
0005 % Usage:
0006 %
0007 % C=corr_logspept(data,win,tapers,pad,Fs,fpass)
0008 % Input:
0009 % Note units have to be consistent. See chronux.m for more information.
0010 %       data (structure array of one channel of spike times; also accepts 1d column vector of spike times) -- required
0011 %       win  (duration of the segments) - required.
0012 %       tapers (precalculated tapers from dpss, or in the form [NW K] e.g [3 5]) -- optional. If not
0013 %                                                 specified, use [NW K]=[3 5]
0014 %        pad            (padding factor for the FFT) - optional. Defaults to 0.
0015 %                       e.g. For N = 500, if PAD = 0, we pad the FFT
0016 %                       to 512 points; if PAD = 2, we pad the FFT
0017 %                       to 2048 points, etc.
0018 %       Fs   (sampling frequency) - optional. Default 1.
0019 %       fpass    (frequency band to be used in the calculation in the form
0020 %                                   [fmin fmax])- optional.
0021 %                                   Default all frequencies between 0 and Fs/2
0022 % Output:
0023 %       C       (correlations in the log spectrum at two different frequencies)
0024 
0025 if nargin < 2; error('Need data and segment information'); end;
0026 if nargin < 3; tapers=[3 5]; end;
0027 if nargin < 4;pad=0;end;
0028 if nargin < 5; Fs=1; end;
0029 if nargin < 6; fpass=[0 Fs/2]; end;
0030 if isempty(tapers); tapers=[3 5]; end;
0031 if isempty(pad);pad=0;end;
0032 if isempty(Fs); Fs=1; end;
0033 if isempty(fpass); fpass=[0 Fs/2]; end;
0034 
0035 [S,f]=mtspectrumsegpt(data,win,tapers,pad,Fs,fpass,0);
0036 lS=log(S)';
0037 [nseg,nf]=size(lS);
0038 lSmean=squeeze(mean(lS));
0039 lS=lS-lSmean(ones(nseg,1),:);
0040 C=cov(lS);
0041

Generated on Tue 07-Jun-2005 12:20:32 by m2html © 2003