2020-07-18 18:56:15 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2023-11-19 00:43:20 -05:00
|
|
|
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
|
|
|
|
// written by Christian Daniel //
|
|
|
|
// Copyright (C) 2016-2020 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
|
2020-07-18 18:56:15 -04:00
|
|
|
// //
|
|
|
|
// 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 //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// 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 <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Half-band centered decimators with Complex (i.e. omplex<float>) input/output
|
|
|
|
// Decimates by a power of two using centered half-band filters
|
|
|
|
|
|
|
|
#ifndef INCLUDE_DSP_DECIMATORC_H_
|
|
|
|
#define INCLUDE_DSP_DECIMATORC_H_
|
|
|
|
|
|
|
|
#include "dsp/dsptypes.h"
|
|
|
|
#include "dsp/inthalfbandfiltereof.h"
|
2020-07-21 00:34:41 -04:00
|
|
|
#include "export.h"
|
2020-07-18 18:56:15 -04:00
|
|
|
|
|
|
|
#define DECIMATORSXS_HB_FILTER_ORDER 64
|
|
|
|
|
2020-07-21 00:34:41 -04:00
|
|
|
class SDRBASE_API DecimatorC
|
2020-07-18 18:56:15 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
DecimatorC();
|
|
|
|
void setLog2Decim(unsigned int log2Decim);
|
|
|
|
bool decimate(Complex c, Complex& cd);
|
|
|
|
unsigned int getDecim() const { return m_decim; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
IntHalfbandFilterEOF<DECIMATORSXS_HB_FILTER_ORDER, true> m_decimator2; // 1st stages
|
|
|
|
IntHalfbandFilterEOF<DECIMATORSXS_HB_FILTER_ORDER, true> m_decimator4; // 2nd stages
|
|
|
|
IntHalfbandFilterEOF<DECIMATORSXS_HB_FILTER_ORDER, true> m_decimator8; // 3rd stages
|
|
|
|
IntHalfbandFilterEOF<DECIMATORSXS_HB_FILTER_ORDER, true> m_decimator16; // 4th stages
|
|
|
|
IntHalfbandFilterEOF<DECIMATORSXS_HB_FILTER_ORDER, true> m_decimator32; // 5th stages
|
|
|
|
IntHalfbandFilterEOF<DECIMATORSXS_HB_FILTER_ORDER, true> m_decimator64; // 6th stages
|
|
|
|
unsigned int m_log2Decim;
|
|
|
|
unsigned int m_decim;
|
|
|
|
|
|
|
|
bool decimate2(Complex c, Complex& cd);
|
|
|
|
bool decimate4(Complex c, Complex& cd);
|
|
|
|
bool decimate8(Complex c, Complex& cd);
|
|
|
|
bool decimate16(Complex c, Complex& cd);
|
|
|
|
bool decimate32(Complex c, Complex& cd);
|
|
|
|
bool decimate64(Complex c, Complex& cd);
|
|
|
|
};
|
|
|
|
|
2023-11-19 00:43:20 -05:00
|
|
|
#endif // INCLUDE_DSP_DECIMATORC_H_
|