(self, spec, fsp, fstims)
| 365 | assert vals[i] > vals[i-2] |
| 366 | |
| 367 | def check_maxfreq(self, spec, fsp, fstims): |
| 368 | # skip the test if there are no frequencies |
| 369 | if len(fstims) == 0: |
| 370 | return |
| 371 | |
| 372 | # if twosided, do the test for each side |
| 373 | if fsp.min() < 0: |
| 374 | fspa = np.abs(fsp) |
| 375 | zeroind = fspa.argmin() |
| 376 | self.check_maxfreq(spec[:zeroind], fspa[:zeroind], fstims) |
| 377 | self.check_maxfreq(spec[zeroind:], fspa[zeroind:], fstims) |
| 378 | return |
| 379 | |
| 380 | fstimst = fstims[:] |
| 381 | spect = spec.copy() |
| 382 | |
| 383 | # go through each peak and make sure it is correctly the maximum peak |
| 384 | while fstimst: |
| 385 | maxind = spect.argmax() |
| 386 | maxfreq = fsp[maxind] |
| 387 | assert_almost_equal(maxfreq, fstimst[-1]) |
| 388 | del fstimst[-1] |
| 389 | spect[maxind-5:maxind+5] = 0 |
| 390 | |
| 391 | def test_spectral_helper_raises(self): |
| 392 | # We don't use parametrize here to handle ``y = self.y``. |
no test coverage detected