RFFT¶
- class acoular.fprocess.RFFT¶
Bases:
BaseSpectra
,SpectraOut
Provides the one-sided Fast Fourier Transform (FFT) for real-valued multichannel time data.
The FFT is calculated block-wise, i.e. the input data is divided into blocks of length
block_size
and the FFT is calculated for each block. Optionally, a window function can be applied to the data before the FFT calculation via thewindow
attribute.- source = Instance(SamplesGenerator)¶
Data source;
SamplesGenerator
or derived object.
- workers = Union(Int(), None, default_value=None, desc='number of workers to use')¶
Number of workers to use for the FFT calculation. If negative values are used, all available logical CPUs will be considered (
scipy.fft.rfft
implementation wraps around fromos.cpu_count()
). Default is None (handled by scipy)
- scaling = Enum('none', 'energy', 'amplitude')¶
Scaling method, either ‘amplitude’, ‘energy’ or
none
. Default isnone
. ‘energy’: compensates for the energy loss due to truncation of the FFT result. The resulting one-sided spectrum is multiplied by 2.0, except for the DC and Nyquist frequency. ‘amplitude’: scales the one-sided spectrum so that the amplitude of discrete tones does not depend on the block size.
- block_size = Property()¶
block size of the FFT. Default is 1024.
- numfreqs = Property(depends_on='_block_size')¶
Number of frequencies in the output.
- numsamples = Property(depends_on='source.numsamples, _block_size')¶
Number of snapshots in the output.
- freqs = Property()¶
1-D array of FFT sample frequencies.
- result(num=1)¶
Python generator that yields the output block-wise.
- Parameters:
- numinteger
This parameter defines the number of multi-channel spectra (i.e. snapshots) per block returned by the generator.
- Returns:
- Spectra block of shape (num,
numchannels`*:attr:`numfreqs
). The last block may be shorter than num.
- Spectra block of shape (num,