Codebox Operators fftstream

fftstream

Fast Fourier Transform

new fftstream([options])

Options

NameTypeDefaultDescription
fftsizeenum512

The first argument specifies the number of points (samples) in the FFT.
It must be a power of two. The default number of points is 512.

Enum Values:
64 | 128 | 256 | 512 | 1024 | 2048 | 4096

framesizeint512

The second argument specifies the number of samples between successive FFTs.
This must be at least the number of points, and must also be a power of two. The default
interval is 512.

phaseint

The third argument specifies the offset into the interval where the
FFT will start. This must either be 0 or a multiple of the signal vector size.
fft~ will correct bad arguments, but if you change the signal vector size after
creating an fft~ and the offset is no longer a multiple of the vector size, the
fft~ will not operate when signal processing is turned on.

win_bufnamesymbolRNBODefaultFftWindow

A {rnbo_buffer~} object can be used as an alternative lookup table for
the FFT window if a custom windowing function is necessary.

windowenumrectangular

Specify which windowing function for the FFT to use (none, the 'rectangular' window,
is the default).

Enum Values:
rectangular | hann | hamming | blackman

Aliases

  • fft

Methods

next(realIn, imagIn): [out1, out2, out3]

Arguments

NameTypeDefaultDescription
realInnumber
imagInnumber

Returns

NameTypeDescription
out1number

The real part of the Fourier transform of the input.
The output begins after all the points of the input have been received.

out2number

The imaginary part of the Fourier transform of the input.
The output begins after all the points of the input have been received.

out3number

A sync signal that ramps from 0 to the number of points minus 1
over the period in which the FFT output occurs. You can use this signal as an
input to the index~ object to perform calculations in the frequency domain.
When the FFT is not being sent out (in the case where the interval is larger
than the number of points), the sync signal is 0.

reset(): void