From 125a967ee33c624e853aee6fb72442aa9203b06f Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Mon, 7 Sep 2015 20:53:55 -0400 Subject: [PATCH] svp header update --- src/process/SpectrumVisualProcessor.h | 72 --------------------------- 1 file changed, 72 deletions(-) diff --git a/src/process/SpectrumVisualProcessor.h b/src/process/SpectrumVisualProcessor.h index 149c170..6b7d079 100644 --- a/src/process/SpectrumVisualProcessor.h +++ b/src/process/SpectrumVisualProcessor.h @@ -69,75 +69,3 @@ private: std::atomic_int desiredInputSize; std::mutex busy_run; }; - - -class FFTDataDistributor : public VisualProcessor { -public: - FFTDataDistributor() : linesPerSecond(DEFAULT_WATERFALL_LPS), lineRateAccum(0.0) { - } - - void setFFTSize(int fftSize) { - this->fftSize = fftSize; - } - - void setLinesPerSecond(int lines) { - this->linesPerSecond = lines; - } - - int getLinesPerSecond() { - return this->linesPerSecond; - } -protected: - void process() { - while (!input->empty()) { - if (!isAnyOutputEmpty()) { - return; - } - DemodulatorThreadIQData *inp; - input->pop(inp); - - int fftSize = this->fftSize; - - if (fftSize > inp->data.size()) { - fftSize = inp->data.size(); - } - - // number of milliseconds contained in input - double inputTime = (double)inp->data.size() / (double)inp->sampleRate; - // number of lines in input - int inputLines = floor((double)inp->data.size()/(double)fftSize); - - // ratio required to achieve the desired rate - double lineRateStep = ((double)linesPerSecond * inputTime)/(double)inputLines; - - if (inp) { - if (inp->data.size() >= fftSize) { - if (lineRateAccum + (lineRateStep * floor((double)inp->data.size()/(double)fftSize)) < 1.0) { - // move along, nothing to see here.. - lineRateAccum += (lineRateStep * inp->data.size()/fftSize); - } else for (int i = 0, iMax = inp->data.size()-fftSize; i <= iMax; i += fftSize) { - lineRateAccum += lineRateStep; - - if (lineRateAccum >= 1.0) { - DemodulatorThreadIQData *outp = outputBuffers.getBuffer(); - outp->frequency = inp->frequency; - outp->sampleRate = inp->sampleRate; - outp->data.assign(inp->data.begin()+i,inp->data.begin()+i+fftSize); - distribute(outp); - - while (lineRateAccum >= 1.0) { - lineRateAccum -= 1.0; - } - } - } - } - inp->decRefCount(); - } - } - } - - ReBuffer outputBuffers; - int fftSize; - int linesPerSecond; - double lineRateAccum; -};