Ejemplo n.º 1
0
def test_sine():
    for period in PERIODS:
        s = sequences.sine(1.0, period, CYCLES, period / 3)
        p = periodogram_peaks(s, thresh=1.0)
        assert len(p) == 1 and p[0][2] <= period and p[0][3] >= period
Ejemplo n.º 2
0
def test_square_wave():
    for period in PERIODS:
        s = sequences.impulses(period / 5, period, CYCLES, period / 3)
        p = periodogram_peaks(s, thresh=1.0)
        assert len(p) == 1 and p[0][2] <= period and p[0][3] >= period
Ejemplo n.º 3
0
def test_zeros():
    assert periodogram_peaks(np.zeros(1000)) == None
Ejemplo n.º 4
0
def test_sine():
    for period in PERIODS:
        s = sequences.sine(1.0, period, CYCLES, period // 3)
        p = periodogram_peaks(s, thresh=1.0)
        assert len(p) == 1 and p[0][2] <= period and p[0][3] >= period
Ejemplo n.º 5
0
def test_square_wave():
    for period in PERIODS:
        s = sequences.impulses(period // 5, period, CYCLES, period // 3)
        p = periodogram_peaks(s, thresh=1.0)
        assert len(p) == 1 and p[0][2] <= period and p[0][3] >= period
Ejemplo n.º 6
0
def test_zeros():
    assert periodogram_peaks(np.zeros(1000)) == None