Axes.
csd
(x, y, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None, return_line=None, *, data=None, **kwargs)[source]¶Plot the cross-spectral density.
The cross spectral density \(P_{xy}\) by Welch's average periodogram method. The vectors x and y are divided into NFFT length segments. Each segment is detrended by function detrend and windowed by function window. noverlap gives the length of the overlap between segments. The product of the direct FFTs of x and y are averaged over each segment to compute \(P_{xy}\), with a scaling to correct for power loss due to windowing.
If len(x) < NFFT or len(y) < NFFT, they will be zero padded to NFFT.
Parameters: | x, y : 1-D arrays or sequences
Fs : scalar
window : callable or ndarray
sides : {'default', 'onesided', 'twosided'}
pad_to : int
NFFT : int
detrend : {'none', 'mean', 'linear'} or callable, default 'none'
scale_by_freq : bool, optional
noverlap : int
Fc : int
return_line : bool
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: | Pxy : 1-D array
freqs : 1-D array
line : a
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Other Parameters: | **kwargs
|
Notes
For plotting, the power is plotted as
\(10\log_{10}(P_{xy})\) for decibels, though P_{xy}
itself
is returned.
References
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John Wiley & Sons (1986)
Note
In addition to the above described arguments, this function can take a data keyword argument. If such a data argument is given, the following arguments are replaced by data[<arg>]:
Objects passed as data must support item access (data[<arg>]
) and
membership test (<arg> in data
).