noise fix
This commit is contained in:
@@ -45,7 +45,7 @@ class NoiseMeasurement:
|
|||||||
def from_time_series(
|
def from_time_series(
|
||||||
cls,
|
cls,
|
||||||
signal: Sequence[float],
|
signal: Sequence[float],
|
||||||
dt: float,
|
dt: float = 1.0,
|
||||||
window: str | None = "Hann",
|
window: str | None = "Hann",
|
||||||
num_segments: int = 1,
|
num_segments: int = 1,
|
||||||
force_no_dc: bool = True,
|
force_no_dc: bool = True,
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ def test_time_and_back():
|
|||||||
def test_nyquist():
|
def test_nyquist():
|
||||||
"""
|
"""
|
||||||
generating a time series and tranforming it back yields the same spectrum.
|
generating a time series and tranforming it back yields the same spectrum.
|
||||||
Using segements, the nyquist frequency at least is the same
|
Using segements, the nyquist frequency is exactly spread out over the frequency bin width
|
||||||
"""
|
"""
|
||||||
signal = np.cos(np.arange(1024) * np.pi)
|
signal = np.cos(np.arange(1024) * np.pi)
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ def test_nyquist():
|
|||||||
n3 = sc.noise.NoiseMeasurement.from_time_series(signal, 1, None, 3)
|
n3 = sc.noise.NoiseMeasurement.from_time_series(signal, 1, None, 3)
|
||||||
n15 = sc.noise.NoiseMeasurement.from_time_series(signal, 1, None, 15)
|
n15 = sc.noise.NoiseMeasurement.from_time_series(signal, 1, None, 15)
|
||||||
|
|
||||||
assert n1.psd[-1] == n3.psd[-1] == n15.psd[-1]
|
assert n1.psd[-1] == n3.psd[-1] * 2 == n15.psd[-1] * 8
|
||||||
|
|
||||||
|
|
||||||
def test_sampling():
|
def test_sampling():
|
||||||
|
|||||||
Reference in New Issue
Block a user