def csd(timeseries, other, segmentlength, noverlap=None, **kwargs):
<EOL>try:<EOL><INDENT>freqs, csd_ = scipy.signal.csd(<EOL>timeseries.value, other.value, noverlap=noverlap,<EOL>fs=timeseries.sample_rate.decompose().value,<EOL>nperseg=segmentlength, **kwargs)<EOL><DEDENT>except AttributeError as exc:<EOL><INDENT>exc.args = ('<STR_LIT>'.format(str(exc)),)<EOL>raise<EOL><DEDENT>unit = scale_timeseries_unit(timeseries.unit,<EOL>kwargs.get('<STR_LIT>', '<STR_LIT>'))<EOL>return FrequencySeries(<EOL>csd_, unit=unit, frequencies=freqs,<EOL>name=str(timeseries.name)+'<STR_LIT>'+str(other.name),<EOL>epoch=timeseries.epoch, channel=timeseries.channel)<EOL>
Calculate the CSD of two `TimeSeries` using Welch's method

    Parameters
    ----------
    timeseries : `~gwpy.timeseries.TimeSeries`
        time-series of data

    other : `~gwpy.timeseries.TimeSeries`
        time-series of data

    segmentlength : `int`
        number of samples in single average.

    noverlap : `int`
        number of samples to overlap between segments, defaults to 50%.

    **kwargs
        other keyword arguments are passed to :meth:`scipy.signal.csd`

    Returns
    -------
    spectrum : `~gwpy.frequencyseries.FrequencySeries`
        average power `FrequencySeries`

    See also
    --------
    scipy.signal.csd