mne.time_frequency.
CrossSpectralDensity
(data, ch_names, frequencies, n_fft, tmin=None, tmax=None, projs=None)[source]¶Crossspectral density.
Given a list of time series, the CSD matrix denotes for each pair of time series, the crossspectral density. This matrix is symmetric and internally stored as a vector.
This object can store multiple CSD matrices: one for each frequency.
Use .get_data(freq)
to obtain an CSD matrix as an ndarray.
Parameters: 


See also
csd_fourier
, csd_multitaper
, csd_morlet
, csd_array_fourier
, csd_array_multitaper
, csd_array_morlet
Attributes: 


Methods
__getitem__ (sel) 
Subselect frequencies. 
__hash__ ($self, /) 
Return hash(self). 
__len__ () 
Return number of frequencies. 
copy () 
Return copy of the CrossSpectralDensity object. 
get_data ([frequency, index]) 
Get the CSD matrix for a given frequency as NumPy array. 
mean ([fmin, fmax]) 
Calculate the mean CSD in the given frequency range(s). 
pick_frequency ([freq, index]) 
Get a CrossSpectralDensity object with only the given frequency. 
plot ([info, mode, colorbar, cmap, n_cols, show]) 
Plot CSD matrices. 
save (fname) 
Save the CSD to an HDF5 file. 
sum ([fmin, fmax]) 
Calculate the sum CSD in the given frequency range(s). 
__getitem__
(sel)[source]¶Subselect frequencies.
Parameters: 


Returns: 

__hash__
($self, /)¶Return hash(self).
get_data
(frequency=None, index=None)[source]¶Get the CSD matrix for a given frequency as NumPy array.
If there is only one matrix defined in the CSD object, calling this
method without any parameters will return it. If multiple matrices are
defined, use either the frequency
or index
parameter to select
one.
Parameters: 


Returns: 

See also
mean
(fmin=None, fmax=None)[source]¶Calculate the mean CSD in the given frequency range(s).
Parameters: 


Returns: 

n_channels
¶Number of time series defined in this CSD object.
pick_frequency
(freq=None, index=None)[source]¶Get a CrossSpectralDensity object with only the given frequency.
Parameters: 


Returns: 

See also
plot
(info=None, mode='csd', colorbar=True, cmap='viridis', n_cols=None, show=True)[source]¶Plot CSD matrices.
A subplot is created for each frequency. If an info object is passed to the function, different channel types are plotted in different figures.
Parameters: 


Returns: 

save
(fname)[source]¶Save the CSD to an HDF5 file.
Parameters: 


See also
read_csd
sum
(fmin=None, fmax=None)[source]¶Calculate the sum CSD in the given frequency range(s).
If the exact given frequencies are not available, the nearest frequencies will be chosen.
Parameters: 


Returns: 
