diff --git a/include.old/audio/audiodeviceinfo.h b/include.old/audio/audiodeviceinfo.h
deleted file mode 100644
index c2a018651..000000000
--- a/include.old/audio/audiodeviceinfo.h
+++ /dev/null
@@ -1,49 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
-// written by Christian Daniel //
-// //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation as version 3 of the License, or //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU General Public License V3 for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program. If not, see . //
-///////////////////////////////////////////////////////////////////////////////////
-
-#ifndef INCLUDE_AUDIODEVICEINFO_H
-#define INCLUDE_AUDIODEVICEINFO_H
-
-#include
-#include "util/export.h"
-
-class SDRANGEL_API AudioDeviceInfo {
-public:
- struct Device {
- QString name;
- QString api;
- int id;
-
- Device(const QString& _name, const QString& _api, int _id) :
- name(_name),
- api(_api),
- id(_id)
- { }
- };
- typedef QList Devices;
-
- AudioDeviceInfo();
-
- int match(const QString& api, const QString device) const;
-
- const Devices& getDevices() const { return m_devices; }
-
-private:
- Devices m_devices;
-};
-
-#endif // INCLUDE_AUDIODEVICEINFO_H
diff --git a/include.old/audio/audiofifo.h b/include.old/audio/audiofifo.h
deleted file mode 100644
index ce6b1ba89..000000000
--- a/include.old/audio/audiofifo.h
+++ /dev/null
@@ -1,67 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
-// written by Christian Daniel //
-// //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation as version 3 of the License, or //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU General Public License V3 for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program. If not, see . //
-///////////////////////////////////////////////////////////////////////////////////
-
-#ifndef INCLUDE_AUDIOFIFO_H
-#define INCLUDE_AUDIOFIFO_H
-
-#include
-#include
-#include
-#include "util/export.h"
-
-class SDRANGEL_API AudioFifo : public QObject {
- Q_OBJECT
-public:
- AudioFifo();
- AudioFifo(uint sampleSize, uint numSamples);
- ~AudioFifo();
-
- bool setSize(uint sampleSize, uint numSamples);
-
- uint write(const quint8* data, uint numSamples, int timeout_ms = INT_MAX);
- uint read(quint8* data, uint numSamples, int timeout_ms = INT_MAX);
-
- uint drain(uint numSamples);
- void clear();
-
- inline uint flush() { return drain(m_fill); }
- inline uint fill() const { return m_fill; }
- inline bool isEmpty() const { return m_fill == 0; }
- inline bool isFull() const { return m_fill == m_size; }
- inline uint size() const { return m_size; }
-
-private:
- QMutex m_mutex;
-
- qint8* m_fifo;
-
- uint m_sampleSize;
-
- uint m_size;
- uint m_fill;
- uint m_head;
- uint m_tail;
-
- QMutex m_writeWaitLock;
- QMutex m_readWaitLock;
- QWaitCondition m_writeWaitCondition;
- QWaitCondition m_readWaitCondition;
-
- bool create(uint sampleSize, uint numSamples);
-};
-
-#endif // INCLUDE_AUDIOFIFO_H
diff --git a/include.old/audio/audiooutput.h b/include.old/audio/audiooutput.h
deleted file mode 100644
index eeb802333..000000000
--- a/include.old/audio/audiooutput.h
+++ /dev/null
@@ -1,62 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
-// written by Christian Daniel //
-// //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation as version 3 of the License, or //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU General Public License V3 for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program. If not, see . //
-///////////////////////////////////////////////////////////////////////////////////
-
-#ifndef INCLUDE_AUDIOOUTPUT_H
-#define INCLUDE_AUDIOOUTPUT_H
-
-#include
-#include
-#include
-#include
-#include
-#include "util/export.h"
-
-class QAudioOutput;
-class AudioFifo;
-class AudioOutputPipe;
-
-class SDRANGEL_API AudioOutput : QIODevice {
-public:
- AudioOutput();
- virtual ~AudioOutput();
-
- bool start(int device, int rate);
- void stop();
-
- void addFifo(AudioFifo* audioFifo);
- void removeFifo(AudioFifo* audioFifo);
-
- uint getRate() const { return m_audioFormat.sampleRate(); }
-
-private:
- QMutex m_mutex;
- QAudioOutput* m_audioOutput;
-
- typedef std::list AudioFifos;
- AudioFifos m_audioFifos;
- std::vector m_mixBuffer;
-
- QAudioFormat m_audioFormat;
-
- //virtual bool open(OpenMode mode);
- virtual qint64 readData(char* data, qint64 maxLen);
- virtual qint64 writeData(const char* data, qint64 len);
-
- friend class AudioOutputPipe;
-};
-
-#endif // INCLUDE_AUDIOOUTPUT_H
diff --git a/include.old/dsp/afsquelch.h b/include.old/dsp/afsquelch.h
deleted file mode 100644
index eb587995d..000000000
--- a/include.old/dsp/afsquelch.h
+++ /dev/null
@@ -1,90 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2015 Edouard Griffiths, F4EXB. //
-// //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation as version 3 of the License, or //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU General Public License V3 for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program. If not, see . //
-///////////////////////////////////////////////////////////////////////////////////
-
-#ifndef INCLUDE_GPL_DSP_AFSQUELCH_H_
-#define INCLUDE_GPL_DSP_AFSQUELCH_H_
-
-#include "dsp/dsptypes.h"
-#include "dsp/movingaverage.h"
-
-/** AFSquelch: AF squelch class based on the Modified Goertzel
- * algorithm.
- */
-class AFSquelch {
-public:
- // Constructors and Destructor
- AFSquelch();
- // allows user defined tone pair
- AFSquelch(unsigned int nbTones,
- const Real *tones);
- virtual ~AFSquelch();
-
- // setup the basic parameters and coefficients
- void setCoefficients(
- int N, //!< the algorithm "block" size
- unsigned int nbAvg, //!< averaging size
- int SampleRate, //!< input signal sample rate
- int _samplesAttack, //!< number of results before squelch opens
- int _samplesDecay); //!< number of results keeping squelch open
-
- // set the detection threshold
- void setThreshold(double _threshold);
-
- // analyze a sample set and optionally filter
- // the tone frequencies.
- bool analyze(Real sample); // input signal sample
- bool evaluate(); // evaluate result
-
- // get the tone set
- const Real *getToneSet() const
- {
- return m_toneSet;
- }
-
- bool open() const {
- return m_isOpen;
- }
-
- void reset(); // reset the analysis algorithm
-
-protected:
- void feedback(Real sample);
- void feedForward();
-
-private:
- unsigned int m_nbAvg; //!< number of power samples taken for moving average
- int m_N;
- int m_sampleRate;
- int m_samplesProcessed;
- int m_maxPowerIndex;
- int m_nTones;
- int m_samplesAttack;
- int m_attackCount;
- int m_samplesDecay;
- int m_decayCount;
- bool m_isOpen;
- double m_threshold;
- double *m_k;
- double *m_coef;
- Real *m_toneSet;
- double *m_u0;
- double *m_u1;
- double *m_power;
- std::vector > m_movingAverages;
-};
-
-
-#endif /* INCLUDE_GPL_DSP_CTCSSDETECTOR_H_ */
diff --git a/include.old/dsp/agc.h b/include.old/dsp/agc.h
deleted file mode 100644
index e6e320800..000000000
--- a/include.old/dsp/agc.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * kissagc.h
- *
- * Created on: May 12, 2015
- * Author: f4exb
- */
-
-#ifndef INCLUDE_GPL_DSP_AGC_H_
-#define INCLUDE_GPL_DSP_AGC_H_
-
-#include "movingaverage.h"
-
-class AGC
-{
-public:
-
- AGC();
- AGC(int historySize, Real R);
- virtual ~AGC();
-
- void resize(int historySize, Real R);
- Real getValue();
- Real getAverage();
- virtual void feed(Complex& ci) = 0;
-
-protected:
- Real m_u0;
- Real m_R; // objective mag
- MovingAverage m_moving_average; // Averaging engine. The stack length conditions the smoothness of AGC.
- int m_historySize;
- int m_count;
-};
-
-class MagSquaredAGC : public AGC
-{
-public:
- MagSquaredAGC();
- MagSquaredAGC(int historySize, Real R);
- virtual ~MagSquaredAGC();
- virtual void feed(Complex& ci);
- Real getMagSq() const { return m_magsq; }
-private:
- Real m_magsq;
-};
-
-class MagAGC : public AGC
-{
-public:
- MagAGC();
- MagAGC(int historySize, Real R);
- virtual ~MagAGC();
- virtual void feed(Complex& ci);
- Real getMagSq() const { return m_magsq; }
-private:
- Real m_magsq;
-};
-
-class AlphaAGC : public AGC
-{
-public:
- AlphaAGC();
- AlphaAGC(int historySize, Real R);
- AlphaAGC(int historySize, Real R, Real alpha);
- virtual ~AlphaAGC();
- void resize(int historySize, Real R, Real alpha);
- virtual void feed(Complex& ci);
- Real getMagSq() const { return m_magsq; }
-private:
- Real m_alpha;
- Real m_magsq;
- bool m_squelchOpen;
-};
-
-class SimpleAGC
-{
-public:
- SimpleAGC() :
- m_squelchOpen(false),
- m_fill(0),
- m_cutoff(0),
- m_clip(0),
- m_moving_average()
- {}
-
- SimpleAGC(int historySize, Real initial, Real cutoff=0, Real clip=0) :
- m_squelchOpen(false),
- m_fill(initial),
- m_cutoff(cutoff),
- m_clip(clip),
- m_moving_average(historySize, initial)
- {}
-
- void resize(int historySize, Real initial, Real cutoff=0, Real clip=0)
- {
- m_fill = initial;
- m_cutoff = cutoff;
- m_clip = clip;
- m_moving_average.resize(historySize, initial);
- }
-
- Real getValue()
- {
- if (m_moving_average.average() > m_clip)
- {
- return m_moving_average.average();
- } else
- {
- return m_clip;
- }
- }
-
- void feed(Real value)
- {
- if (value > m_cutoff)
- {
- m_moving_average.feed(value);
- }
- }
-
-private:
- bool m_squelchOpen; // open for processing
- Real m_fill; // refill average at this level
- Real m_cutoff; // consider samples only above this level
- Real m_clip; // never go below this level
- MovingAverage m_moving_average; // Averaging engine. The stack length conditions the smoothness of AGC.
-};
-
-#endif /* INCLUDE_GPL_DSP_AGC_H_ */
diff --git a/include.old/dsp/bandpass.h b/include.old/dsp/bandpass.h
deleted file mode 100644
index 3e0ffb147..000000000
--- a/include.old/dsp/bandpass.h
+++ /dev/null
@@ -1,127 +0,0 @@
-#ifndef INCLUDE_BANDPASS_H
-#define INCLUDE_BANDPASS_H
-
-#define _USE_MATH_DEFINES
-#include
-#include "dsp/dsptypes.h"
-
-template class Bandpass {
-public:
- Bandpass() { }
-
- void create(int nTaps, double sampleRate, double lowCutoff, double highCutoff)
- {
- std::vector taps_lp;
- std::vector taps_hp;
- double wcl = 2.0 * M_PI * lowCutoff;
- double Wcl = wcl / sampleRate;
- double wch = 2.0 * M_PI * highCutoff;
- double Wch = wch / sampleRate;
- int i;
-
- // check constraints
- if(!(nTaps & 1)) {
- qDebug("Bandpass filter has to have an odd number of taps");
- nTaps++;
- }
-
- // make room
- m_samples.resize(nTaps);
- for(int i = 0; i < nTaps; i++)
- m_samples[i] = 0;
- m_ptr = 0;
- m_taps.resize(nTaps / 2 + 1);
- taps_lp.resize(nTaps / 2 + 1);
- taps_hp.resize(nTaps / 2 + 1);
-
- // generate Sinc filter core
- for(i = 0; i < nTaps / 2 + 1; i++) {
- if(i == (nTaps - 1) / 2) {
- taps_lp[i] = Wch / M_PI;
- taps_hp[i] = -(Wcl / M_PI);
- }
- else {
- taps_lp[i] = sin(((double)i - ((double)nTaps - 1.0) / 2.0) * Wch) / (((double)i - ((double)nTaps - 1.0) / 2.0) * M_PI);
- taps_hp[i] = -sin(((double)i - ((double)nTaps - 1.0) / 2.0) * Wcl) / (((double)i - ((double)nTaps - 1.0) / 2.0) * M_PI);
- }
- }
-
- taps_hp[(nTaps - 1) / 2] += 1;
-
- // apply Hamming window and combine lowpass and highpass
- for(i = 0; i < nTaps / 2 + 1; i++) {
- taps_lp[i] *= 0.54 + 0.46 * cos((2.0 * M_PI * ((double)i - ((double)nTaps - 1.0) / 2.0)) / (double)nTaps);
- taps_hp[i] *= 0.54 + 0.46 * cos((2.0 * M_PI * ((double)i - ((double)nTaps - 1.0) / 2.0)) / (double)nTaps);
- m_taps[i] = -(taps_lp[i]+taps_hp[i]);
- }
-
- m_taps[(nTaps - 1) / 2] += 1;
-
- // normalize
- Real sum = 0;
-
- for(i = 0; i < (int)m_taps.size() - 1; i++) {
- sum += m_taps[i] * 2;
- }
-
- sum += m_taps[i];
-
- for(i = 0; i < (int)m_taps.size(); i++) {
- m_taps[i] /= sum;
- }
- }
-
- Type filter(Type sample)
- {
- Type acc = 0;
- int a = m_ptr;
- int b = a - 1;
- int i, n_taps, size;
-
- m_samples[m_ptr] = sample;
- size = m_samples.size(); // Valgrind optim (2)
-
- while(b < 0)
- {
- b += size;
- }
-
- n_taps = m_taps.size() - 1; // Valgrind optim
-
- for(i = 0; i < n_taps; i++)
- {
- acc += (m_samples[a] + m_samples[b]) * m_taps[i];
- a++;
-
- while (a >= size)
- {
- a -= size;
- }
-
- b--;
-
- while(b < 0)
- {
- b += size;
- }
- }
-
- acc += m_samples[a] * m_taps[i];
-
- m_ptr++;
-
- while (m_ptr >= size)
- {
- m_ptr -= size;
- }
-
- return acc;
- }
-
-private:
- std::vector m_taps;
- std::vector m_samples;
- int m_ptr;
-};
-
-#endif // INCLUDE_BANDPASS_H
diff --git a/include.old/dsp/channelizer.h b/include.old/dsp/channelizer.h
deleted file mode 100644
index a45b21fed..000000000
--- a/include.old/dsp/channelizer.h
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef INCLUDE_CHANNELIZER_H
-#define INCLUDE_CHANNELIZER_H
-
-#include
-#include
-#include "dsp/samplesink.h"
-#include "util/export.h"
-#include "util/message.h"
-
-class MessageQueue;
-class IntHalfbandFilter;
-
-class SDRANGEL_API Channelizer : public SampleSink {
- Q_OBJECT
-public:
- class SDRANGEL_API MsgChannelizerNotification : public Message {
- MESSAGE_CLASS_DECLARATION
-
- public:
- MsgChannelizerNotification(int samplerate, qint64 frequencyOffset) :
- Message(),
- m_sampleRate(samplerate),
- m_frequencyOffset(frequencyOffset)
- { }
-
- int getSampleRate() const { return m_sampleRate; }
- qint64 getFrequencyOffset() const { return m_frequencyOffset; }
-
- private:
- int m_sampleRate;
- qint64 m_frequencyOffset;
- };
-
- Channelizer(SampleSink* sampleSink);
- virtual ~Channelizer();
-
- void configure(MessageQueue* messageQueue, int sampleRate, int centerFrequency);
- int getInputSampleRate() const { return m_inputSampleRate; }
-
- virtual void start();
- virtual void stop();
- virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly);
- virtual bool handleMessage(const Message& cmd);
-
-protected:
- struct FilterStage {
- enum Mode {
- ModeCenter,
- ModeLowerHalf,
- ModeUpperHalf
- };
-
- typedef bool (IntHalfbandFilter::*WorkFunction)(Sample* s);
- IntHalfbandFilter* m_filter;
- WorkFunction m_workFunction;
-
- FilterStage(Mode mode);
- ~FilterStage();
-
- bool work(Sample* sample)
- {
- return (m_filter->*m_workFunction)(sample);
- }
- };
- typedef std::list FilterStages;
- FilterStages m_filterStages;
- SampleSink* m_sampleSink;
- int m_inputSampleRate;
- int m_requestedOutputSampleRate;
- int m_requestedCenterFrequency;
- int m_currentOutputSampleRate;
- int m_currentCenterFrequency;
- SampleVector m_sampleBuffer;
- QMutex m_mutex;
-
- void applyConfiguration();
- bool signalContainsChannel(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd) const;
- Real createFilterChain(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd);
- void freeFilterChain();
-
-signals:
- void inputSampleRateChanged();
-};
-
-#endif // INCLUDE_CHANNELIZER_H
diff --git a/include.old/dsp/channelmarker.h b/include.old/dsp/channelmarker.h
deleted file mode 100644
index 66ed138ab..000000000
--- a/include.old/dsp/channelmarker.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef INCLUDE_CHANNELMARKER_H
-#define INCLUDE_CHANNELMARKER_H
-
-#include
-#include
-#include "util/export.h"
-
-class SDRANGEL_API ChannelMarker : public QObject {
- Q_OBJECT
-
-public:
- typedef enum sidebands_e
- {
- dsb,
- lsb,
- usb
- } sidebands_t;
-
- ChannelMarker(QObject* parent = NULL);
-
- void setTitle(const QString& title);
- const QString& getTitle() const { return m_title; }
-
- void setCenterFrequency(int centerFrequency);
- int getCenterFrequency() const { return m_centerFrequency; }
-
- void setBandwidth(int bandwidth);
- int getBandwidth() const { return m_bandwidth; }
-
- void setLowCutoff(int lowCutoff);
- int getLowCutoff() const { return m_lowCutoff; }
-
- void setSidebands(sidebands_t sidebands);
- sidebands_t getSidebands() const { return m_sidebands; }
-
- void setVisible(bool visible);
- bool getVisible() const { return m_visible; }
-
- void setHighlighted(bool highlighted);
- bool getHighlighted() const { return m_highlighted; }
-
- void setColor(const QColor& color);
- const QColor& getColor() const { return m_color; }
-
-protected:
- static QRgb m_colorTable[];
- static int m_nextColor;
-
- QString m_title;
- int m_centerFrequency;
- int m_bandwidth;
- int m_lowCutoff;
- sidebands_t m_sidebands;
- bool m_visible;
- bool m_highlighted;
- QColor m_color;
-
-signals:
- void changed();
-};
-
-#endif // INCLUDE_CHANNELMARKER_H
diff --git a/include.old/dsp/complex.h b/include.old/dsp/complex.h
deleted file mode 100644
index 2653a591c..000000000
--- a/include.old/dsp/complex.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// ----------------------------------------------------------------------------
-// complex.h -- Complex arithmetic
-//
-// Copyright (C) 2006-2008
-// Dave Freese, W1HKJ
-// Copyright (C) 2008
-// Stelios Bounanos, M0GLD
-//
-// This file is part of fldigi.
-//
-// Fldigi is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Fldigi is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with fldigi. If not, see .
-// ----------------------------------------------------------------------------
-
-#ifndef _COMPLEX_H
-#define _COMPLEX_H
-
-#include
-#include
-
-typedef std::complex cmplx;
-
-inline cmplx cmac (const cmplx *a, const cmplx *b, int ptr, int len) {
- cmplx z;
- ptr %= len;
- for (int i = 0; i < len; i++) {
- z += a[i] * b[ptr];
- ptr = (ptr + 1) % len;
- }
- return z;
-}
-
-#endif
diff --git a/include.old/dsp/ctcssdetector.h b/include.old/dsp/ctcssdetector.h
deleted file mode 100644
index e3799c07c..000000000
--- a/include.old/dsp/ctcssdetector.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * ctcssdetector.h
- *
- * Created on: Jun 16, 2015
- * Author: f4exb
- * See: http://www.embedded.com/design/connectivity/4025660/Detecting-CTCSS-tones-with-Goertzel-s-algorithm
- */
-
-#ifndef INCLUDE_GPL_DSP_CTCSSDETECTOR_H_
-#define INCLUDE_GPL_DSP_CTCSSDETECTOR_H_
-
-#include "dsp/dsptypes.h"
-
-/** CTCSSDetector: Continuous Tone Coded Squelch System
- * tone detector class based on the Modified Goertzel
- * algorithm.
- */
-class CTCSSDetector {
-public:
- // Constructors and Destructor
- CTCSSDetector();
- // allows user defined CTCSS tone set
- CTCSSDetector(int _nTones, Real *tones);
- virtual ~CTCSSDetector();
-
- // setup the basic parameters and coefficients
- void setCoefficients(
- int zN, // the algorithm "block" size
- int SampleRate); // input signal sample rate
-
- // set the detection threshold
- void setThreshold(double thold);
-
- // analyze a sample set and optionally filter
- // the tone frequencies.
- bool analyze(Real *sample); // input signal sample
-
- // get the number of defined tones.
- int getNTones() const {
- return nTones;
- }
-
- // get the tone set
- const Real *getToneSet() const
- {
- return toneSet;
- }
-
- // get the currently detected tone, if any
- bool getDetectedTone(int &maxTone) const
- {
- maxTone = maxPowerIndex;
- return toneDetected;
- }
-
- // Get the max power at the detected tone.
- Real getMaxPower() const
- {
- return maxPower;
- }
-
- void reset(); // reset the analysis algorithm
-
-protected:
- // Override these to change behavior of the detector
- virtual void initializePower();
- virtual void evaluatePower();
- void feedback(Real sample);
- void feedForward();
-
-private:
- int N;
- int sampleRate;
- int nTones;
- int samplesProcessed;
- int maxPowerIndex;
- bool toneDetected;
- Real maxPower;
- Real *k;
- Real *coef;
- Real *toneSet;
- Real *u0;
- Real *u1;
- Real *power;
-};
-
-
-#endif /* INCLUDE_GPL_DSP_CTCSSDETECTOR_H_ */
diff --git a/include.old/dsp/decimators.h b/include.old/dsp/decimators.h
deleted file mode 100644
index 403e908fc..000000000
--- a/include.old/dsp/decimators.h
+++ /dev/null
@@ -1,1538 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 2015 Edouard Griffiths, F4EXB //
-// //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation as version 3 of the License, or //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU General Public License V3 for more details. //
-// //
-// You should have received a copy of the GNU General Public License //
-// along with this program. If not, see . //
-///////////////////////////////////////////////////////////////////////////////////
-
-#ifndef INCLUDE_GPL_DSP_DECIMATORS_H_
-#define INCLUDE_GPL_DSP_DECIMATORS_H_
-
-#include "dsp/dsptypes.h"
-#include "dsp/inthalfbandfilter.h"
-
-template
-struct decimation_shifts
-{
- static const uint pre1 = 0;
- static const uint pre2 = 0;
- static const uint post2 = 0;
- static const uint pre4 = 0;
- static const uint post4 = 0;
- static const uint pre8 = 0;
- static const uint post8 = 0;
- static const uint pre16 = 0;
- static const uint post16 = 0;
- static const uint pre32 = 0;
- static const uint post32 = 0;
- static const uint pre64 = 0;
- static const uint post64 = 0;
-};
-
-template<>
-struct decimation_shifts<16, 16>
-{
- static const uint pre1 = 0;
- static const uint pre2 = 0;
- static const uint post2 = 1;
- static const uint pre4 = 0;
- static const uint post4 = 2;
- static const uint pre8 = 0;
- static const uint post8 = 3;
- static const uint pre16 = 0;
- static const uint post16 = 4;
- static const uint pre32 = 0;
- static const uint post32 = 5;
- static const uint pre64 = 0;
- static const uint post64 = 6;
-};
-
-template<>
-struct decimation_shifts<16, 12>
-{
- static const uint pre1 = 4;
- static const uint pre2 = 3;
- static const uint post2 = 0;
- static const uint pre4 = 2;
- static const uint post4 = 0;
- static const uint pre8 = 1;
- static const uint post8 = 0;
- static const uint pre16 = 0;
- static const uint post16 = 0;
- static const uint pre32 = 0;
- static const uint post32 = 1;
- static const uint pre64 = 0;
- static const uint post64 = 2;
-};
-
-template<>
-struct decimation_shifts<16, 8>
-{
- static const uint pre1 = 6;
- static const uint pre2 = 5;
- static const uint post2 = 0;
- static const uint pre4 = 4;
- static const uint post4 = 0;
- static const uint pre8 = 3;
- static const uint post8 = 0;
- static const uint pre16 = 2;
- static const uint post16 = 0;
- static const uint pre32 = 1;
- static const uint post32 = 0;
- static const uint pre64 = 0;
- static const uint post64 = 0;
-};
-
-template
-class Decimators
-{
-public:
- void decimate1(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len);
- void decimate64_cen(SampleVector::iterator* it, const T* buf, qint32 len);
-
-private:
- IntHalfbandFilter m_decimator2; // 1st stages
- IntHalfbandFilter m_decimator4; // 2nd stages
- IntHalfbandFilter m_decimator8; // 3rd stages
- IntHalfbandFilter m_decimator16; // 4th stages
- IntHalfbandFilter m_decimator32; // 5th stages
- IntHalfbandFilter m_decimator64; // 6th stages
-};
-
-template
-void Decimators::decimate1(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal, yimag;
-
- for (int pos = 0; pos < len - 1; pos += 2)
- {
- xreal = buf[pos+0];
- yimag = buf[pos+1];
- (**it).setReal(xreal << decimation_shifts::pre1); // Valgrind optim (2 - comment not repeated)
- (**it).setImag(yimag << decimation_shifts::pre1);
- ++(*it); // Valgrind optim (comment not repeated)
- }
-}
-
-template
-void Decimators::decimate2_u(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal, yimag;
-
- for (int pos = 0; pos < len - 7; pos += 8)
- {
- xreal = (buf[pos+0] - buf[pos+3]) << decimation_shifts::pre2;
- yimag = (buf[pos+1] + buf[pos+2] - 255) << decimation_shifts::pre2;
- (**it).setReal(xreal >> decimation_shifts::post2);
- (**it).setImag(yimag >> decimation_shifts::post2);
- ++(*it);
-
- xreal = (buf[pos+7] - buf[pos+4]) << decimation_shifts::pre2;
- yimag = (255 - buf[pos+5] - buf[pos+6]) << decimation_shifts::pre2;
- (**it).setReal(xreal >> decimation_shifts::post2);
- (**it).setImag(yimag >> decimation_shifts::post2);
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate2_inf(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal, yimag;
-
- for (int pos = 0; pos < len - 7; pos += 8)
- {
- xreal = (buf[pos+0] - buf[pos+3]) << decimation_shifts::pre2;
- yimag = (buf[pos+1] + buf[pos+2]) << decimation_shifts::pre2;
- (**it).setReal(xreal >> decimation_shifts::post2);
- (**it).setImag(yimag >> decimation_shifts::post2);
- ++(*it);
-
- xreal = (buf[pos+7] - buf[pos+4]) << decimation_shifts::pre2;
- yimag = (- buf[pos+5] - buf[pos+6]) << decimation_shifts::pre2;
- (**it).setReal(xreal >> decimation_shifts::post2);
- (**it).setImag(yimag >> decimation_shifts::post2);
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate2_sup(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal, yimag;
-
- for (int pos = 0; pos < len - 7; pos += 8)
- {
- xreal = (buf[pos+1] - buf[pos+2]) << decimation_shifts::pre2;
- yimag = (- buf[pos+0] - buf[pos+3]) << decimation_shifts::pre2;
- (**it).setReal(xreal >> decimation_shifts::post2);
- (**it).setImag(yimag >> decimation_shifts::post2);
- ++(*it);
-
- xreal = (buf[pos+6] - buf[pos+5]) << decimation_shifts::pre2;
- yimag = (buf[pos+4] + buf[pos+7]) << decimation_shifts::pre2;
- (**it).setReal(xreal >> decimation_shifts::post2);
- (**it).setImag(yimag >> decimation_shifts::post2);
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate4_inf(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal, yimag;
-
- for (int pos = 0; pos < len - 7; pos += 8)
- {
- xreal = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts::pre4;
- yimag = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts::pre4;
-
- (**it).setReal(xreal >> decimation_shifts::post4);
- (**it).setImag(yimag >> decimation_shifts::post4);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate4_sup(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- // Sup (USB):
- // x y x y x y x y / x -> 1,-2,-5,6 / y -> -0,-3,4,7
- // [ rotate: 1, 0, -2, 3, -5, -4, 6, -7]
- // Inf (LSB):
- // x y x y x y x y / x -> 0,-3,-4,7 / y -> 1,2,-5,-6
- // [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
- qint32 xreal, yimag;
-
- for (int pos = 0; pos < len - 7; pos += 8)
- {
- xreal = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts::pre4;
- yimag = (- buf[pos+0] - buf[pos+3] + buf[pos+4] + buf[pos+7]) << decimation_shifts::pre4;
-
- (**it).setReal(xreal >> decimation_shifts::post4);
- (**it).setImag(yimag >> decimation_shifts::post4);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate8_inf(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal[2], yimag[2];
-
- for (int pos = 0; pos < len - 15; pos += 8)
- {
- xreal[0] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts::pre8;
- yimag[0] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts::pre8;
- pos += 8;
-
- xreal[1] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts::pre8;
- yimag[1] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts::pre8;
-
- m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
-
- (**it).setReal(xreal[1] >> decimation_shifts::post8);
- (**it).setImag(yimag[1] >> decimation_shifts::post8);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate8_sup(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal[2], yimag[2];
-
- for (int pos = 0; pos < len - 15; pos += 8)
- {
- xreal[0] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts::pre8;
- yimag[0] = (- buf[pos+0] - buf[pos+3] + buf[pos+4] + buf[pos+7]) << decimation_shifts::pre8;
- pos += 8;
-
- xreal[1] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts::pre8;
- yimag[1] = (- buf[pos+0] - buf[pos+3] + buf[pos+4] + buf[pos+7]) << decimation_shifts::pre8;
-
- m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
-
- (**it).setReal(xreal[1] >> decimation_shifts::post8);
- (**it).setImag(yimag[1] >> decimation_shifts::post8);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate16_inf(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- // Offset tuning: 4x downsample and rotate, then
- // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6]
- qint32 xreal[4], yimag[4];
-
- for (int pos = 0; pos < len - 31; )
- {
- for (int i = 0; i < 4; i++)
- {
- xreal[i] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts::pre16;
- yimag[i] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts::pre16;
- pos += 8;
- }
-
- m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
- m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
-
- m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
-
- (**it).setReal(xreal[3] >> decimation_shifts::post16);
- (**it).setImag(yimag[3] >> decimation_shifts::post16);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate16_sup(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- // Offset tuning: 4x downsample and rotate, then
- // downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7]
- qint32 xreal[4], yimag[4];
-
- for (int pos = 0; pos < len - 31; )
- {
- for (int i = 0; i < 4; i++)
- {
- xreal[i] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts::pre16;
- yimag[i] = (buf[pos+4] + buf[pos+7] - buf[pos+0] - buf[pos+3]) << decimation_shifts::pre16;
- pos += 8;
- }
-
- m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
- m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
-
- m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
-
- (**it).setReal(xreal[3] >> decimation_shifts::post16);
- (**it).setImag(yimag[3] >> decimation_shifts::post16);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate32_inf(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal[8], yimag[8];
-
- for (int pos = 0; pos < len - 63; )
- {
- for (int i = 0; i < 8; i++)
- {
- xreal[i] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts::pre32;
- yimag[i] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts::pre32;
- pos += 8;
- }
-
- m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
- m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
- m_decimator2.myDecimate(xreal[4], yimag[4], &xreal[5], &yimag[5]);
- m_decimator2.myDecimate(xreal[6], yimag[6], &xreal[7], &yimag[7]);
-
- m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
- m_decimator4.myDecimate(xreal[5], yimag[5], &xreal[7], &yimag[7]);
-
- m_decimator8.myDecimate(xreal[3], yimag[3], &xreal[7], &yimag[7]);
-
- (**it).setReal(xreal[7] >> decimation_shifts::post32);
- (**it).setImag(yimag[7] >> decimation_shifts::post32);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate32_sup(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal[8], yimag[8];
-
- for (int pos = 0; pos < len - 63; )
- {
- for (int i = 0; i < 8; i++)
- {
- xreal[i] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts::pre32;
- yimag[i] = (buf[pos+4] + buf[pos+7] - buf[pos+0] - buf[pos+3]) << decimation_shifts::pre32;
- pos += 8;
- }
-
- m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
- m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
- m_decimator2.myDecimate(xreal[4], yimag[4], &xreal[5], &yimag[5]);
- m_decimator2.myDecimate(xreal[6], yimag[6], &xreal[7], &yimag[7]);
-
- m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
- m_decimator4.myDecimate(xreal[5], yimag[5], &xreal[7], &yimag[7]);
-
- m_decimator8.myDecimate(xreal[3], yimag[3], &xreal[7], &yimag[7]);
-
- (**it).setReal(xreal[7] >> decimation_shifts::post32);
- (**it).setImag(yimag[7] >> decimation_shifts::post32);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate64_inf(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal[16], yimag[16];
-
- for (int pos = 0; pos < len - 127; )
- {
- for (int i = 0; i < 16; i++)
- {
- xreal[i] = (buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4]) << decimation_shifts::pre64;
- yimag[i] = (buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6]) << decimation_shifts::pre64;
- pos += 8;
- }
-
- m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
- m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
- m_decimator2.myDecimate(xreal[4], yimag[4], &xreal[5], &yimag[5]);
- m_decimator2.myDecimate(xreal[6], yimag[6], &xreal[7], &yimag[7]);
- m_decimator2.myDecimate(xreal[8], yimag[8], &xreal[9], &yimag[9]);
- m_decimator2.myDecimate(xreal[10], yimag[10], &xreal[11], &yimag[11]);
- m_decimator2.myDecimate(xreal[12], yimag[12], &xreal[13], &yimag[13]);
- m_decimator2.myDecimate(xreal[14], yimag[14], &xreal[15], &yimag[15]);
-
- m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
- m_decimator4.myDecimate(xreal[5], yimag[5], &xreal[7], &yimag[7]);
- m_decimator4.myDecimate(xreal[9], yimag[9], &xreal[11], &yimag[11]);
- m_decimator4.myDecimate(xreal[13], yimag[13], &xreal[15], &yimag[15]);
-
- m_decimator8.myDecimate(xreal[3], yimag[3], &xreal[7], &yimag[7]);
- m_decimator8.myDecimate(xreal[11], yimag[11], &xreal[15], &yimag[15]);
-
- m_decimator16.myDecimate(xreal[7], yimag[7], &xreal[15], &yimag[15]);
-
- (**it).setReal(xreal[15] >> decimation_shifts::post64);
- (**it).setImag(yimag[15] >> decimation_shifts::post64);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate64_sup(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 xreal[16], yimag[16];
-
- for (int pos = 0; pos < len - 127; )
- {
- for (int i = 0; i < 16; i++)
- {
- xreal[i] = (buf[pos+1] - buf[pos+2] - buf[pos+5] + buf[pos+6]) << decimation_shifts::pre32;
- yimag[i] = (buf[pos+4] + buf[pos+7] - buf[pos+0] - buf[pos+3]) << decimation_shifts::pre32;
- pos += 8;
- }
-
- m_decimator2.myDecimate(xreal[0], yimag[0], &xreal[1], &yimag[1]);
- m_decimator2.myDecimate(xreal[2], yimag[2], &xreal[3], &yimag[3]);
- m_decimator2.myDecimate(xreal[4], yimag[4], &xreal[5], &yimag[5]);
- m_decimator2.myDecimate(xreal[6], yimag[6], &xreal[7], &yimag[7]);
- m_decimator2.myDecimate(xreal[8], yimag[8], &xreal[9], &yimag[9]);
- m_decimator2.myDecimate(xreal[10], yimag[10], &xreal[11], &yimag[11]);
- m_decimator2.myDecimate(xreal[12], yimag[12], &xreal[13], &yimag[13]);
- m_decimator2.myDecimate(xreal[14], yimag[14], &xreal[15], &yimag[15]);
-
- m_decimator4.myDecimate(xreal[1], yimag[1], &xreal[3], &yimag[3]);
- m_decimator4.myDecimate(xreal[5], yimag[5], &xreal[7], &yimag[7]);
- m_decimator4.myDecimate(xreal[9], yimag[9], &xreal[11], &yimag[11]);
- m_decimator4.myDecimate(xreal[13], yimag[13], &xreal[15], &yimag[15]);
-
- m_decimator8.myDecimate(xreal[3], yimag[3], &xreal[7], &yimag[7]);
- m_decimator8.myDecimate(xreal[11], yimag[11], &xreal[15], &yimag[15]);
-
- m_decimator16.myDecimate(xreal[7], yimag[7], &xreal[15], &yimag[15]);
-
- (**it).setReal(xreal[15] >> decimation_shifts::post64);
- (**it).setImag(yimag[15] >> decimation_shifts::post64);
-
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate2_cen(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 intbuf[2];
-
- for (int pos = 0; pos < len - 3; pos += 4)
- {
- intbuf[0] = buf[pos+2] << decimation_shifts::pre2;
- intbuf[1] = buf[pos+3] << decimation_shifts::pre2;
-
- m_decimator2.myDecimate(
- buf[pos+0] << decimation_shifts::pre2,
- buf[pos+1] << decimation_shifts::pre2,
- &intbuf[0],
- &intbuf[1]);
-
- (**it).setReal(intbuf[0] >> decimation_shifts::post2);
- (**it).setImag(intbuf[1] >> decimation_shifts::post2);
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate4_cen(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 intbuf[4];
-
- for (int pos = 0; pos < len - 7; pos += 8)
- {
- intbuf[0] = buf[pos+2] << decimation_shifts::pre4;
- intbuf[1] = buf[pos+3] << decimation_shifts::pre4;
- intbuf[2] = buf[pos+6] << decimation_shifts::pre4;
- intbuf[3] = buf[pos+7] << decimation_shifts::pre4;
-
- m_decimator2.myDecimate(
- buf[pos+0] << decimation_shifts::pre4,
- buf[pos+1] << decimation_shifts::pre4,
- &intbuf[0],
- &intbuf[1]);
- m_decimator2.myDecimate(
- buf[pos+4] << decimation_shifts::pre4,
- buf[pos+5] << decimation_shifts::pre4,
- &intbuf[2],
- &intbuf[3]);
-
- m_decimator4.myDecimate(
- intbuf[0],
- intbuf[1],
- &intbuf[2],
- &intbuf[3]);
-
- (**it).setReal(intbuf[2] >> decimation_shifts::post4);
- (**it).setImag(intbuf[3] >> decimation_shifts::post4);
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate8_cen(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 intbuf[8];
-
- for (int pos = 0; pos < len - 15; pos += 16)
- {
- intbuf[0] = buf[pos+2] << decimation_shifts::pre8;
- intbuf[1] = buf[pos+3] << decimation_shifts::pre8;
- intbuf[2] = buf[pos+6] << decimation_shifts::pre8;
- intbuf[3] = buf[pos+7] << decimation_shifts::pre8;
- intbuf[4] = buf[pos+10] << decimation_shifts::pre8;
- intbuf[5] = buf[pos+11] << decimation_shifts::pre8;
- intbuf[6] = buf[pos+14] << decimation_shifts::pre8;
- intbuf[7] = buf[pos+15] << decimation_shifts::pre8;
-
- m_decimator2.myDecimate(
- buf[pos+0] << decimation_shifts::pre8,
- buf[pos+1] << decimation_shifts::pre8,
- &intbuf[0],
- &intbuf[1]);
- m_decimator2.myDecimate(
- buf[pos+4] << decimation_shifts::pre8,
- buf[pos+5] << decimation_shifts::pre8,
- &intbuf[2],
- &intbuf[3]);
- m_decimator2.myDecimate(
- buf[pos+8] << decimation_shifts::pre8,
- buf[pos+9] << decimation_shifts::pre8,
- &intbuf[4],
- &intbuf[5]);
- m_decimator2.myDecimate(
- buf[pos+12] << decimation_shifts::pre8,
- buf[pos+13] << decimation_shifts::pre8,
- &intbuf[6],
- &intbuf[7]);
-
- m_decimator4.myDecimate(
- intbuf[0],
- intbuf[1],
- &intbuf[2],
- &intbuf[3]);
- m_decimator4.myDecimate(
- intbuf[4],
- intbuf[5],
- &intbuf[6],
- &intbuf[7]);
-
- m_decimator8.myDecimate(
- intbuf[2],
- intbuf[3],
- &intbuf[6],
- &intbuf[7]);
-
- (**it).setReal(intbuf[6] >> decimation_shifts::post8);
- (**it).setImag(intbuf[7] >> decimation_shifts::post8);
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate16_cen(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 intbuf[16];
-
- for (int pos = 0; pos < len - 31; pos += 32)
- {
- intbuf[0] = buf[pos+2] << decimation_shifts::pre16;
- intbuf[1] = buf[pos+3] << decimation_shifts::pre16;
- intbuf[2] = buf[pos+6] << decimation_shifts::pre16;
- intbuf[3] = buf[pos+7] << decimation_shifts::pre16;
- intbuf[4] = buf[pos+10] << decimation_shifts::pre16;
- intbuf[5] = buf[pos+11] << decimation_shifts::pre16;
- intbuf[6] = buf[pos+14] << decimation_shifts::pre16;
- intbuf[7] = buf[pos+15] << decimation_shifts::pre16;
- intbuf[8] = buf[pos+18] << decimation_shifts::pre16;
- intbuf[9] = buf[pos+19] << decimation_shifts::pre16;
- intbuf[10] = buf[pos+22] << decimation_shifts::pre16;
- intbuf[11] = buf[pos+23] << decimation_shifts::pre16;
- intbuf[12] = buf[pos+26] << decimation_shifts::pre16;
- intbuf[13] = buf[pos+27] << decimation_shifts::pre16;
- intbuf[14] = buf[pos+30] << decimation_shifts::pre16;
- intbuf[15] = buf[pos+31] << decimation_shifts::pre16;
-
- m_decimator2.myDecimate(
- buf[pos+0] << decimation_shifts::pre16,
- buf[pos+1] << decimation_shifts::pre16,
- &intbuf[0],
- &intbuf[1]);
- m_decimator2.myDecimate(
- buf[pos+4] << decimation_shifts::pre16,
- buf[pos+5] << decimation_shifts::pre16,
- &intbuf[2],
- &intbuf[3]);
- m_decimator2.myDecimate(
- buf[pos+8] << decimation_shifts::pre16,
- buf[pos+9] << decimation_shifts::pre16,
- &intbuf[4],
- &intbuf[5]);
- m_decimator2.myDecimate(
- buf[pos+12] << decimation_shifts::pre16,
- buf[pos+13] << decimation_shifts::pre16,
- &intbuf[6],
- &intbuf[7]);
- m_decimator2.myDecimate(
- buf[pos+16] << decimation_shifts::pre16,
- buf[pos+17] << decimation_shifts::pre16,
- &intbuf[8],
- &intbuf[9]);
- m_decimator2.myDecimate(
- buf[pos+20] << decimation_shifts::pre16,
- buf[pos+21] << decimation_shifts::pre16,
- &intbuf[10],
- &intbuf[11]);
- m_decimator2.myDecimate(
- buf[pos+24] << decimation_shifts::pre16,
- buf[pos+25] << decimation_shifts::pre16,
- &intbuf[12],
- &intbuf[13]);
- m_decimator2.myDecimate(
- buf[pos+28] << decimation_shifts::pre16,
- buf[pos+29] << decimation_shifts::pre16,
- &intbuf[14],
- &intbuf[15]);
-
- m_decimator4.myDecimate(
- intbuf[0],
- intbuf[1],
- &intbuf[2],
- &intbuf[3]);
- m_decimator4.myDecimate(
- intbuf[4],
- intbuf[5],
- &intbuf[6],
- &intbuf[7]);
- m_decimator4.myDecimate(
- intbuf[8],
- intbuf[9],
- &intbuf[10],
- &intbuf[11]);
- m_decimator4.myDecimate(
- intbuf[12],
- intbuf[13],
- &intbuf[14],
- &intbuf[15]);
-
- m_decimator8.myDecimate(
- intbuf[2],
- intbuf[3],
- &intbuf[6],
- &intbuf[7]);
- m_decimator8.myDecimate(
- intbuf[10],
- intbuf[11],
- &intbuf[14],
- &intbuf[15]);
-
- m_decimator16.myDecimate(
- intbuf[6],
- intbuf[7],
- &intbuf[14],
- &intbuf[15]);
-
- (**it).setReal(intbuf[14] >> decimation_shifts::post16);
- (**it).setImag(intbuf[15] >> decimation_shifts::post16);
- ++(*it);
- }
-}
-
-template
-void Decimators::decimate32_cen(SampleVector::iterator* it, const T* buf, qint32 len)
-{
- qint32 intbuf[32];
-
- for (int pos = 0; pos < len - 63; pos += 64)
- {
- intbuf[0] = buf[pos+2] << decimation_shifts::pre32;
- intbuf[1] = buf[pos+3] << decimation_shifts::pre32;
- intbuf[2] = buf[pos+6] << decimation_shifts::pre32;
- intbuf[3] = buf[pos+7] << decimation_shifts::pre32;
- intbuf[4] = buf[pos+10] << decimation_shifts::pre32;
- intbuf[5] = buf[pos+11] << decimation_shifts::pre32;
- intbuf[6] = buf[pos+14] << decimation_shifts::pre32;
- intbuf[7] = buf[pos+15] << decimation_shifts::pre32;
- intbuf[8] = buf[pos+18] << decimation_shifts::pre32;
- intbuf[9] = buf[pos+19] << decimation_shifts::pre32;
- intbuf[10] = buf[pos+22] << decimation_shifts::pre32;
- intbuf[11] = buf[pos+23] << decimation_shifts::pre32;
- intbuf[12] = buf[pos+26] << decimation_shifts::pre32;
- intbuf[13] = buf[pos+27] << decimation_shifts::pre32;
- intbuf[14] = buf[pos+30] << decimation_shifts::pre32;
- intbuf[15] = buf[pos+31] << decimation_shifts::pre32;
- intbuf[16] = buf[pos+34] << decimation_shifts::pre32;
- intbuf[17] = buf[pos+35] << decimation_shifts::pre32;
- intbuf[18] = buf[pos+38] << decimation_shifts::pre32;
- intbuf[19] = buf[pos+39] << decimation_shifts::pre32;
- intbuf[20] = buf[pos+42] << decimation_shifts::pre32;
- intbuf[21] = buf[pos+43] << decimation_shifts::pre32;
- intbuf[22] = buf[pos+46] << decimation_shifts::pre32;
- intbuf[23] = buf[pos+47] << decimation_shifts::pre32;
- intbuf[24] = buf[pos+50] << decimation_shifts::pre32;
- intbuf[25] = buf[pos+51] << decimation_shifts::pre32;
- intbuf[26] = buf[pos+54] << decimation_shifts::pre32;
- intbuf[27] = buf[pos+55] << decimation_shifts::pre32;
- intbuf[28] = buf[pos+58] << decimation_shifts::pre32;
- intbuf[29] = buf[pos+59] << decimation_shifts::pre32;
- intbuf[30] = buf[pos+62] << decimation_shifts::pre32;
- intbuf[31] = buf[pos+63] << decimation_shifts::pre32;
-
- m_decimator2.myDecimate(
- buf[pos+0] << decimation_shifts::pre32,
- buf[pos+1] << decimation_shifts::pre32,
- &intbuf[0],
- &intbuf[1]);
- m_decimator2.myDecimate(
- buf[pos+4] << decimation_shifts::pre32,
- buf[pos+5] << decimation_shifts::pre32,
- &intbuf[2],
- &intbuf[3]);
- m_decimator2.myDecimate(
- buf[pos+8] << decimation_shifts::pre32,
- buf[pos+9] << decimation_shifts::pre32,
- &intbuf[4],
- &intbuf[5]);
- m_decimator2.myDecimate(
- buf[pos+12] << decimation_shifts::pre32,
- buf[pos+13] << decimation_shifts::pre32,
- &intbuf[6],
- &intbuf[7]);
- m_decimator2.myDecimate(
- buf[pos+16] << decimation_shifts::pre32,
- buf[pos+17] << decimation_shifts::pre32,
- &intbuf[8],
- &intbuf[9]);
- m_decimator2.myDecimate(
- buf[pos+20] << decimation_shifts::pre32,
- buf[pos+21] << decimation_shifts::pre32,
- &intbuf[10],
- &intbuf[11]);
- m_decimator2.myDecimate(
- buf[pos+24] << decimation_shifts::pre32,
- buf[pos+25] << decimation_shifts::pre32,
- &intbuf[12],
- &intbuf[13]);
- m_decimator2.myDecimate(
- buf[pos+28] << decimation_shifts::pre32,
- buf[pos+29] << decimation_shifts