From 400f3be4ae644692018c31a78b63905c1322dafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Sierro?= Date: Thu, 17 Aug 2023 14:51:28 +0200 Subject: [PATCH] new: convenience plottable_dBc --- src/scgenerator/noise.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scgenerator/noise.py b/src/scgenerator/noise.py index 253e26c..76875d3 100644 --- a/src/scgenerator/noise.py +++ b/src/scgenerator/noise.py @@ -118,6 +118,10 @@ class NoiseMeasurement: def psd_dBc(self) -> np.ndarray: return np.log10(self.psd) * 10 + @property + def plottable_dBc(self) -> tuple[np.ndarray, np.ndarray]: + return self.freq[1:], self.psd_dBc[1:] + def sample_spectrum(self, nt: int, dt: float | None = None) -> tuple[np.ndarray, np.ndarray]: """ sample an amplitude spectrum with nt points. The corresponding sample spacing in the time