()
| 810 | |
| 811 | # extra test for cohere... |
| 812 | def test_cohere(): |
| 813 | N = 1024 |
| 814 | np.random.seed(19680801) |
| 815 | x = np.random.randn(N) |
| 816 | # phase offset |
| 817 | y = np.roll(x, 20) |
| 818 | # high-freq roll-off |
| 819 | y = np.convolve(y, np.ones(20) / 20., mode='same') |
| 820 | cohsq, f = mlab.cohere(x, y, NFFT=256, Fs=2, noverlap=128) |
| 821 | assert_allclose(np.mean(cohsq), 0.837, atol=1.e-3) |
| 822 | assert np.isreal(np.mean(cohsq)) |
| 823 | |
| 824 | |
| 825 | # ***************************************************************** |
nothing calls this directly
no test coverage detected
searching dependent graphs…