tsdata_to_cpsd
Estimate cross-power spectral density from time series data
Syntax
S = tsdata_to_cpsd(X,fres,method,window,noverlap,nw,ntapers)
Arguments
See also Common variable names and data structures.
input
X multi-trial time series data fres frequency resolution method estimation method: 'WELCH' (default) or 'MT' window window length (default: min time series trial length and 2*fres) noverlap window overlap size (default: window/2) nw [multi-taper only] multi-taper time bandwidth parameter (default: 3) ntapers [multi-taper only] number of tapers (default: 2*nw-1)
output
S estimated cross-power spectral density (cpsd) matrix
Description
Returns an estimate of the cross-power spectral density of a multivariate process from time series data X, which may be single- or multi-trial. fres specifies the frequency resolution; call freqs = sfreqs(fres,fs), where fs is the sampling rate, to get a corresponding vector freqs of frequencies on [0,fs/2].
NOTE: This function requires the Matlab® Signal Processing Toolbox™.
The window and noverlap parameters specify the window length and window overlap size, respectively. The estimation method may be 'WELCH' for Welch's averaged modified periodogram method (default: see functions pwelch, cpsd in the Matlab® Signal Processing Toolbox™) or 'MT' for a multi-taper estimation procedure. For the multi-taper method, nw is the multi-taper time bandwidth parameter and ntaper the number of tapers. Discrete prolate spheroidal (Slepian) sequences for the multi-taper method are calculated using the function dpss from the Matlab® Signal Processing Toolbox™.
Multi-taper routine adapted from Chronux code [2] authored by Partha Mitra and Kenneth D. Harris.
References
[1] L. Barnett and A. K. Seth, The MVGC Multivariate Granger Causality Toolbox: A New Approach to Granger-causal Inference, J. Neurosci. Methods 223, 2014 [ preprint ].
[2] P. Mitra and H. Bokil, "Observed Brain Dynamics", Oxford University Press, New York, 2008.