void FFTWidget::addSamples(double red, double green, double blue) { qDebug() << "FFTWidget: add sample" << green; dataIn.erase(dataIn.begin()); dataIn.append(green); counter++; if(counter >= fftInterval/sampleInterval) { doFft(); counter = 0; } }
status_t Visualizer::getFft(uint8_t *fft) { if (fft == NULL) { return BAD_VALUE; } if (mCaptureSize == 0) { return NO_INIT; } status_t status = NO_ERROR; if (mEnabled) { uint8_t buf[mCaptureSize]; status = getWaveForm(buf); if (status == NO_ERROR) { status = doFft(fft, buf); } } else { memset(fft, 0, mCaptureSize); } return status; }