def cohere(x, y, NFFT=<NUM_LIT>, Fs=<NUM_LIT:2>, detrend=detrend_none, window=window_hanning,<EOL>noverlap=<NUM_LIT:0>, pad_to=None, sides='<STR_LIT:default>', scale_by_freq=None):
if len(x)<<NUM_LIT:2>*NFFT:<EOL><INDENT>raise ValueError(_coh_error)<EOL><DEDENT>Pxx, f = psd(x, NFFT, Fs, detrend, window, noverlap, pad_to, sides,<EOL>scale_by_freq)<EOL>Pyy, f = psd(y, NFFT, Fs, detrend, window, noverlap, pad_to, sides,<EOL>scale_by_freq)<EOL>Pxy, f = csd(x, y, NFFT, Fs, detrend, window, noverlap, pad_to, sides,<EOL>scale_by_freq)<EOL>Cxy = np.divide(np.absolute(Pxy)**<NUM_LIT:2>, Pxx*Pyy)<EOL>Cxy.shape = (len(f),)<EOL>return Cxy, f<EOL>
The coherence between *x* and *y*.  Coherence is the normalized
cross spectral density:

.. math::

    C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}}

*x*, *y*
    Array or sequence containing the data
%(PSD)s
The return value is the tuple (*Cxy*, *f*), where *f* are the
frequencies of the coherence vector. For cohere, scaling the
individual densities by the sampling frequency has no effect, since
the factors cancel out.

.. seealso::
    :func:`psd` and :func:`csd`:
        For information about the methods used to compute
        :math:`P_{xy}`, :math:`P_{xx}` and :math:`P_{yy}`.