@docstring.dedent_interpd
def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning, noverlap=0, pad_to=None, sides=u'default', scale_by_freq=None):
 if (len(x) < (2 * NFFT)):
  raise ValueError(_coh_error)
 (Pxx, f) = psd(x, NFFT, Fs, detrend, window, noverlap, pad_to, sides, scale_by_freq)
 (Pyy, f) = psd(y, NFFT, Fs, detrend, window, noverlap, pad_to, sides, scale_by_freq)
 (Pxy, f) = csd(x, y, NFFT, Fs, detrend, window, noverlap, pad_to, sides, scale_by_freq)
 Cxy = ((np.abs(Pxy) ** 2) / (Pxx * Pxy))
 return (Cxy, f)

@ docstring . dedent_interpd def cohere ( x , y , NFFT = 256 , Fs = 2 , detrend = detrend_none , window = window_hanning , noverlap = 0 , pad_to = None , sides = u'default' , scale_by_freq = None ) : if ( len ( x ) < ( 2 * NFFT ) ) : raise ValueError ( _coh_error ) ( Pxx , f ) = psd ( x , NFFT , Fs , detrend , window , noverlap , pad_to , sides , scale_by_freq ) ( Pyy , f ) = psd ( y , NFFT , Fs , detrend , window , noverlap , pad_to , sides , scale_by_freq ) ( Pxy , f ) = csd ( x , y , NFFT , Fs , detrend , window , noverlap , pad_to , sides , scale_by_freq ) Cxy = ( ( np . abs ( Pxy ) ** 2 ) / ( Pxx * Pxy ) ) return ( Cxy , f )
the coherence between *x* and *y* .