Collects data from any OpenBCI board and calculate FFT.
Remember that FFT only analyse frequencies up to half of the current sample rate.
create a new instance
board |
an instance of a OpenBCI subclass (for example a CytonSerial or GanglionWifi). |
fftSize |
the FFT window size. Should be a power-of-two. |
windowType |
By default this will be Signal: fftCosTable. Use one of the following symbols to specify other types: |
get the board instance
perform FFT calculation.
data |
an Array of data to be analysed. |
the FFT data (magnitudes only) as an Array. The size of the array is half the fftSize + 1.
the FFT window size
half the FFT window size
width of each frequency band in Hz. The first and last bands is half as large as this value.
convert from fft index to frequency (in Hz).
index |
band index |
a Float that is the middle frequency of the band.
convert from frequency (in Hz) to fft index.
freq |
frequency |
an Integer that is the index of the band that contains the requested frequency.