SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
mainbench.h
Go to the documentation of this file.
1 // Copyright (C) 2018 Edouard Griffiths, F4EXB. //
3 // //
4 // Swagger server adapter interface //
5 // //
6 // This program is free software; you can redistribute it and/or modify //
7 // it under the terms of the GNU General Public License as published by //
8 // the Free Software Foundation as version 3 of the License, or //
9 // (at your option) any later version. //
10 // //
11 // This program is distributed in the hope that it will be useful, //
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14 // GNU General Public License V3 for more details. //
15 // //
16 // You should have received a copy of the GNU General Public License //
17 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
19 
20 #ifndef SDRBENCH_MAINBENCH_H_
21 #define SDRBENCH_MAINBENCH_H_
22 
23 #include <QObject>
24 #include <random>
25 #include <functional>
26 
27 #include "dsp/decimators.h"
28 #include "dsp/decimatorsif.h"
29 #include "dsp/decimatorsfi.h"
30 #include "dsp/decimatorsff.h"
31 #include "parserbench.h"
32 
33 namespace qtwebapp {
34  class LoggerWithFile;
35 }
36 
37 class MainBench: public QObject {
38  Q_OBJECT
39 
40 public:
41  explicit MainBench(qtwebapp::LoggerWithFile *logger, const ParserBench& parser, QObject *parent = 0);
42  ~MainBench();
43 
44 public slots:
45  void run();
46 
47 signals:
48  void finished();
49 
50 private:
51  void testDecimateII(ParserBench::TestType testType = ParserBench::TestDecimatorsII);
52  void testDecimateIF();
53  void testDecimateFI();
54  void testDecimateFF();
55  void testAMBE();
56  void decimateII(const qint16 *buf, int len);
57  void decimateInfII(const qint16 *buf, int len);
58  void decimateSupII(const qint16 *buf, int len);
59  void decimateIF(const qint16 *buf, int len);
60  void decimateFI(const float *buf, int len);
61  void decimateFF(const float *buf, int len);
62  void printResults(const QString& prefix, qint64 nsecs);
63 
67  std::mt19937 m_generator;
68  std::uniform_real_distribution<float> m_uniform_distribution_f;
69  std::uniform_int_distribution<qint16> m_uniform_distribution_s16;
70 
75 
78 };
79 
80 #endif // SDRBENCH_MAINBENCH_H_
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 > m_decimatorsII
Definition: mainbench.h:71
SampleVector m_convertBuffer
Definition: mainbench.h:76
std::vector< Sample > SampleVector
Definition: dsptypes.h:96
DecimatorsFF m_decimatorsFF
Definition: mainbench.h:74
DecimatorsFI m_decimatorsFI
Definition: mainbench.h:73
std::uniform_int_distribution< qint16 > m_uniform_distribution_s16
Definition: mainbench.h:69
FSampleVector m_convertBufferF
Definition: mainbench.h:77
std::vector< FSample > FSampleVector
Definition: dsptypes.h:97
std::uniform_real_distribution< float > m_uniform_distribution_f
Definition: mainbench.h:68
const ParserBench & m_parser
Definition: mainbench.h:66
std::mt19937 m_generator
Definition: mainbench.h:67
DecimatorsIF< qint16, 12 > m_decimatorsIF
Definition: mainbench.h:72
static MainBench * m_instance
Definition: mainbench.h:64
qtwebapp::LoggerWithFile * m_logger
Definition: mainbench.h:65