noise improvements
This commit is contained in:
@@ -55,6 +55,20 @@ def test_time_and_back():
|
||||
assert new_noise.psd == pytest.approx(noise.psd)
|
||||
|
||||
|
||||
def test_nyquist():
|
||||
"""
|
||||
generating a time series and tranforming it back yields the same spectrum.
|
||||
Using segements, the nyquist frequency at least is the same
|
||||
"""
|
||||
signal = np.cos(np.arange(1024) * np.pi)
|
||||
|
||||
n1 = sc.noise.NoiseMeasurement.from_time_series(signal, 1, None, 1)
|
||||
n3 = sc.noise.NoiseMeasurement.from_time_series(signal, 1, None, 3)
|
||||
n15 = sc.noise.NoiseMeasurement.from_time_series(signal, 1, None, 15)
|
||||
|
||||
assert n1.psd[-1] == n3.psd[-1] == n15.psd[-1]
|
||||
|
||||
|
||||
def test_sampling():
|
||||
f = np.geomspace(10, 2e6, 138)
|
||||
spec = 1 / (f + 1)
|
||||
|
||||
Reference in New Issue
Block a user