Computing Spectra

lsl.correlator.fx.calcSpectrum(signal, LFFT=64, window=<function noWindow at 0x36cbe60>, verbose=False)
Worker function for calcSpectra.
lsl.correlator.fx.calcSpectra(signals, LFFT=64, SampleAverage=None, window=<function noWindow at 0x36cbe60>, DisablePool=False, verbose=False, SampleRate=None, CentralFreq=0.0)

Given a collection of time series data with inputs on the first dimension and data on the second, compute the spectra for all inputs. By default, all data in the time series are average into a single spectrum. However, this behavior can be modified if the SampleAverage keyword is set. SampleAverage specifies how many individual spectra of length LFFT are to be averaged.

Changed in version 0.3.4: Prior to LSL version 0.4, the window functions avaliable for calcSpectra were limited to Blackmand and an (untest) Polyphase filter. With version 0.4, the window to be used is passed to the function call via the ‘window’ keyword and an “empty” window is provided by the module. This allows for the various window function defined in numpy (i.e., barlet, blackman, hamming, etc.) to be used. It also makes it easier to filter the data using a custom window. For example, a Kaiser window with a shape factor of 5 could be made with:

>>> import numpy
>>> def newWindow(L):
...      return numpy.kaiser(L, 5)

Previous topic

Data Writers

Next topic

Correlation

This Page