feat: adds real spectrum correction, which might cause problems with older stuff

This commit is contained in:
Deepak Mallubhotla 2024-12-29 21:08:42 -06:00
parent b8e21da9fe
commit 0e52cd61ae
Signed by: deepak
GPG Key ID: BEBAEBF28083E022

View File

@ -32,7 +32,8 @@ class TimeSeriesResult:
return numpy.real(a * numpy.conjugate(a))
def psd(v):
return sq(scipy.fft.rfft(v)[1:]) * self.delta_t / self.num_points
_logger.debug("Using real part correction and multiplying PSD by 2")
return 2 * sq(scipy.fft.rfft(v)[1:]) * self.delta_t / self.num_points
fft_dict = {k: psd(v) for k, v in self.series_dict.items()}
freqs = scipy.fft.rfftfreq(self.num_points, self.delta_t)[1:]