Computing Spectra

lsl.correlator.fx.SpecMaster(signals, LFFT=64, window=<function noWindow at 0x3122b90>, verbose=False, SampleRate=None, CentralFreq=0.0, ClipLevel=0)

A more advanced version of calcSpectra that uses the _spec C extension to handle all of the P.S.D. calculations in parallel. Returns a two- element tuple of the frequencies (in Hz) and PSDs in dB/RBW.

Note

SpecMaster currently average all data given and does not support the SampleAverage keyword that calcSpectra does.

lsl.correlator.fx.SpecMasterP(signals, LFFT=64, window=<function noWindow at 0x3122b90>, verbose=False, SampleRate=None, CentralFreq=0.0, ClipLevel=0)

Similar to SpecMaster but uses a 4-tap polyphase filter bank instead of a FFT. Returns a two-element tuple of the frequencies (in Hz) and PSDs in dB/RBW.

Note

SpecMaster currently average all data given and does not support the SampleAverage keyword that calcSpectra does.

Deprecated

lsl.correlator.fx.calcSpectrum(signal, LFFT=64, window=<function noWindow at 0x3122b90>, verbose=False)
Worker function for calcSpectra.
lsl.correlator.fx.calcSpectra(signals, LFFT=64, SampleAverage=None, window=<function noWindow at 0x3122b90>, 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.3.4, the window functions available for calcSpectra were limited to Blackman and an (untest) Polyphase filter. With version 0.4.0, 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., bartlett, 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)

Table Of Contents

Previous topic

Data Writers

Next topic

Correlation

This Page