resistics.spectra.calculator module

class resistics.spectra.calculator.SpectrumCalculator(sampleFreq: float, winSamples: int, config: Optional[Dict] = None)[source]

Bases: resistics.common.base.ResisticsBase

Class for calculating spectra from time data windows

The class requires the pyfftw and FFTW3 libraries, which allow for fast fourier transforms for spectra calculations

Attributes
sampleFreqfloat

Sample frequency of the data

numSamplesint

The number of samples in each window

windowbool (true)

Flag for applying a window function before fourier transform

windowFuncnp.ndarray

Window function to apply to time data before fourier transform

dataArraynp.ndarray

numpy array to copy data into before performing fourier transform

ffotObjpyfftw.FFTW

fourier transform object

Methods

__init__(sampleFreq, winSamples, config=None)

Initialise with time data sampling frequency and the number of samples in a window

calcFourierTransform(timeData)

Perform fourier transform for timeData and return specData object

printList()

Class status returned as list of strings

calcFourierCoeff(self, timeData: resistics.time.data.TimeData) → resistics.spectra.data.SpectrumData[source]

Fast fourier transform of timeData

Parameters
timeDataTimeData

A TimeData object

Returns
specDataSpectrumData

A SpectrumData object

printList(self) → List[source]

Class information as a list of strings

Returns
outlist

List of strings with information