OpenBCI / OpenBCI_GUI

A cross platform application for the OpenBCI Cyton and Ganglion. Tested on Mac, Windows and Ubuntu/Mint Linux.
MIT License
708 stars 257 forks source link

Linear FFT amplitude is incorrect #1203

Open philippitts opened 10 months ago

philippitts commented 10 months ago

Problem

The linear FFT amplitude is calculated incorrectly in the FFT Plot widget.

Expected

image (5)

In the above example, the time series peak to peak value is measured at +/- 1500uV. The plot indicates a peak at 800uV, but the peak should be at 1500uV.

Operating System and Version

Windows 10

GUI Version

5.2.2

Are you running the downloaded app or from Processing/VSCode?

Downloaded app

Type of OpenBCI Board

Ganglion

bobthefairycat commented 10 months ago

The DFT computed is likely using the exponential representation of the Fourier series, the coefficients on the negative values of frequency mirror those on the positive side, e.g.: https://www.thefouriertransform.com/series/cosineExample.php

You would expect the positive side to be half the actual amplitude, since the original signal is constructed as a sum including the component from the negative side.