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.
Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MainBench Class Reference

#include <mainbench.h>

Inherits QObject.

+ Collaboration diagram for MainBench:

Public Slots

void run ()
 

Signals

void finished ()
 

Public Member Functions

 MainBench (qtwebapp::LoggerWithFile *logger, const ParserBench &parser, QObject *parent=0)
 
 ~MainBench ()
 

Private Member Functions

void testDecimateII (ParserBench::TestType testType=ParserBench::TestDecimatorsII)
 
void testDecimateIF ()
 
void testDecimateFI ()
 
void testDecimateFF ()
 
void testAMBE ()
 
void decimateII (const qint16 *buf, int len)
 
void decimateInfII (const qint16 *buf, int len)
 
void decimateSupII (const qint16 *buf, int len)
 
void decimateIF (const qint16 *buf, int len)
 
void decimateFI (const float *buf, int len)
 
void decimateFF (const float *buf, int len)
 
void printResults (const QString &prefix, qint64 nsecs)
 

Private Attributes

qtwebapp::LoggerWithFilem_logger
 
const ParserBenchm_parser
 
std::mt19937 m_generator
 
std::uniform_real_distribution< float > m_uniform_distribution_f
 
std::uniform_int_distribution< qint16 > m_uniform_distribution_s16
 
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 > m_decimatorsII
 
DecimatorsIF< qint16, 12 > m_decimatorsIF
 
DecimatorsFI m_decimatorsFI
 
DecimatorsFF m_decimatorsFF
 
SampleVector m_convertBuffer
 
FSampleVector m_convertBufferF
 

Static Private Attributes

static MainBenchm_instance = 0
 

Detailed Description

Definition at line 37 of file mainbench.h.

Constructor & Destructor Documentation

◆ MainBench()

MainBench::MainBench ( qtwebapp::LoggerWithFile logger,
const ParserBench parser,
QObject *  parent = 0 
)
explicit

Definition at line 29 of file mainbench.cpp.

References m_instance.

29  :
30  QObject(parent),
31  m_logger(logger),
32  m_parser(parser),
33  m_uniform_distribution_f(-1.0, 1.0),
34  m_uniform_distribution_s16(-2048, 2047)
35 {
36  qDebug() << "MainBench::MainBench: start";
37  m_instance = this;
38  qDebug() << "MainBench::MainBench: end";
39 }
std::uniform_int_distribution< qint16 > m_uniform_distribution_s16
Definition: mainbench.h:69
std::uniform_real_distribution< float > m_uniform_distribution_f
Definition: mainbench.h:68
const ParserBench & m_parser
Definition: mainbench.h:66
static MainBench * m_instance
Definition: mainbench.h:64
qtwebapp::LoggerWithFile * m_logger
Definition: mainbench.h:65

◆ ~MainBench()

MainBench::~MainBench ( )

Definition at line 41 of file mainbench.cpp.

42 {}

Member Function Documentation

◆ decimateFF()

void MainBench::decimateFF ( const float *  buf,
int  len 
)
private

Definition at line 370 of file mainbench.cpp.

References DecimatorsFF::decimate1(), DecimatorsFF::decimate16_cen(), DecimatorsFF::decimate2_cen(), DecimatorsFF::decimate32_cen(), DecimatorsFF::decimate4_cen(), DecimatorsFF::decimate64_cen(), DecimatorsFF::decimate8_cen(), ParserBench::getLog2Factor(), m_convertBufferF, m_decimatorsFF, and m_parser.

Referenced by testDecimateFF().

371 {
372  FSampleVector::iterator it = m_convertBufferF.begin();
373 
374  switch (m_parser.getLog2Factor())
375  {
376  case 0:
377  m_decimatorsFF.decimate1(&it, buf, len);
378  break;
379  case 1:
380  m_decimatorsFF.decimate2_cen(&it, buf, len);
381  break;
382  case 2:
383  m_decimatorsFF.decimate4_cen(&it, buf, len);
384  break;
385  case 3:
386  m_decimatorsFF.decimate8_cen(&it, buf, len);
387  break;
388  case 4:
389  m_decimatorsFF.decimate16_cen(&it, buf, len);
390  break;
391  case 5:
392  m_decimatorsFF.decimate32_cen(&it, buf, len);
393  break;
394  case 6:
395  m_decimatorsFF.decimate64_cen(&it, buf, len);
396  break;
397  default:
398  break;
399  }
400 }
void decimate4_cen(FSampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
DecimatorsFF m_decimatorsFF
Definition: mainbench.h:74
void decimate64_cen(FSampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
void decimate32_cen(FSampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
void decimate2_cen(FSampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
uint32_t getLog2Factor() const
Definition: parserbench.h:48
FSampleVector m_convertBufferF
Definition: mainbench.h:77
void decimate16_cen(FSampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
const ParserBench & m_parser
Definition: mainbench.h:66
void decimate8_cen(FSampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
void decimate1(FSampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decimateFI()

void MainBench::decimateFI ( const float *  buf,
int  len 
)
private

Definition at line 338 of file mainbench.cpp.

References DecimatorsFI::decimate1(), DecimatorsFI::decimate16_cen(), DecimatorsFI::decimate2_cen(), DecimatorsFI::decimate32_cen(), DecimatorsFI::decimate4_cen(), DecimatorsFI::decimate64_cen(), DecimatorsFI::decimate8_cen(), ParserBench::getLog2Factor(), m_convertBuffer, m_decimatorsFI, and m_parser.

Referenced by testDecimateFI().

339 {
340  SampleVector::iterator it = m_convertBuffer.begin();
341 
342  switch (m_parser.getLog2Factor())
343  {
344  case 0:
345  m_decimatorsFI.decimate1(&it, buf, len);
346  break;
347  case 1:
348  m_decimatorsFI.decimate2_cen(&it, buf, len);
349  break;
350  case 2:
351  m_decimatorsFI.decimate4_cen(&it, buf, len);
352  break;
353  case 3:
354  m_decimatorsFI.decimate8_cen(&it, buf, len);
355  break;
356  case 4:
357  m_decimatorsFI.decimate16_cen(&it, buf, len);
358  break;
359  case 5:
360  m_decimatorsFI.decimate32_cen(&it, buf, len);
361  break;
362  case 6:
363  m_decimatorsFI.decimate64_cen(&it, buf, len);
364  break;
365  default:
366  break;
367  }
368 }
SampleVector m_convertBuffer
Definition: mainbench.h:76
void decimate32_cen(SampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
DecimatorsFI m_decimatorsFI
Definition: mainbench.h:73
void decimate16_cen(SampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
uint32_t getLog2Factor() const
Definition: parserbench.h:48
void decimate2_cen(SampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
void decimate4_cen(SampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
void decimate8_cen(SampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
const ParserBench & m_parser
Definition: mainbench.h:66
void decimate64_cen(SampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
void decimate1(SampleVector::iterator *it, const float *buf, qint32 nbIAndQ)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decimateIF()

void MainBench::decimateIF ( const qint16 *  buf,
int  len 
)
private

Definition at line 306 of file mainbench.cpp.

References DecimatorsIF< T, InputBits >::decimate1(), DecimatorsIF< T, InputBits >::decimate16_cen(), DecimatorsIF< T, InputBits >::decimate2_cen(), DecimatorsIF< T, InputBits >::decimate32_cen(), DecimatorsIF< T, InputBits >::decimate4_cen(), DecimatorsIF< T, InputBits >::decimate64_cen(), DecimatorsIF< T, InputBits >::decimate8_cen(), ParserBench::getLog2Factor(), m_convertBufferF, m_decimatorsIF, and m_parser.

Referenced by testDecimateIF().

307 {
308  FSampleVector::iterator it = m_convertBufferF.begin();
309 
310  switch (m_parser.getLog2Factor())
311  {
312  case 0:
313  m_decimatorsIF.decimate1(&it, buf, len);
314  break;
315  case 1:
316  m_decimatorsIF.decimate2_cen(&it, buf, len);
317  break;
318  case 2:
319  m_decimatorsIF.decimate4_cen(&it, buf, len);
320  break;
321  case 3:
322  m_decimatorsIF.decimate8_cen(&it, buf, len);
323  break;
324  case 4:
325  m_decimatorsIF.decimate16_cen(&it, buf, len);
326  break;
327  case 5:
328  m_decimatorsIF.decimate32_cen(&it, buf, len);
329  break;
330  case 6:
331  m_decimatorsIF.decimate64_cen(&it, buf, len);
332  break;
333  default:
334  break;
335  }
336 }
void decimate64_cen(FSampleVector::iterator *it, const T *buf, qint32 nbIAndQ)
Definition: decimatorsif.h:851
void decimate4_cen(FSampleVector::iterator *it, const T *buf, qint32 nbIAndQ)
Definition: decimatorsif.h:201
void decimate1(FSampleVector::iterator *it, const T *buf, qint32 nbIAndQ)
Definition: decimatorsif.h:87
uint32_t getLog2Factor() const
Definition: parserbench.h:48
FSampleVector m_convertBufferF
Definition: mainbench.h:77
void decimate8_cen(FSampleVector::iterator *it, const T *buf, qint32 nbIAndQ)
Definition: decimatorsif.h:282
const ParserBench & m_parser
Definition: mainbench.h:66
void decimate16_cen(FSampleVector::iterator *it, const T *buf, qint32 nbIAndQ)
Definition: decimatorsif.h:394
DecimatorsIF< qint16, 12 > m_decimatorsIF
Definition: mainbench.h:72
void decimate2_cen(FSampleVector::iterator *it, const T *buf, qint32 nbIAndQ)
Definition: decimatorsif.h:144
void decimate32_cen(FSampleVector::iterator *it, const T *buf, qint32 nbIAndQ)
Definition: decimatorsif.h:565
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decimateII()

void MainBench::decimateII ( const qint16 *  buf,
int  len 
)
private

Definition at line 210 of file mainbench.cpp.

References Decimators< StorageType, T, SdrBits, InputBits >::decimate1(), Decimators< StorageType, T, SdrBits, InputBits >::decimate16_cen(), Decimators< StorageType, T, SdrBits, InputBits >::decimate2_cen(), Decimators< StorageType, T, SdrBits, InputBits >::decimate32_cen(), Decimators< StorageType, T, SdrBits, InputBits >::decimate4_cen(), Decimators< StorageType, T, SdrBits, InputBits >::decimate64_cen(), Decimators< StorageType, T, SdrBits, InputBits >::decimate8_cen(), ParserBench::getLog2Factor(), m_convertBuffer, m_decimatorsII, and m_parser.

Referenced by testDecimateII().

211 {
212  SampleVector::iterator it = m_convertBuffer.begin();
213 
214  switch (m_parser.getLog2Factor())
215  {
216  case 0:
217  m_decimatorsII.decimate1(&it, buf, len);
218  break;
219  case 1:
220  m_decimatorsII.decimate2_cen(&it, buf, len);
221  break;
222  case 2:
223  m_decimatorsII.decimate4_cen(&it, buf, len);
224  break;
225  case 3:
226  m_decimatorsII.decimate8_cen(&it, buf, len);
227  break;
228  case 4:
229  m_decimatorsII.decimate16_cen(&it, buf, len);
230  break;
231  case 5:
232  m_decimatorsII.decimate32_cen(&it, buf, len);
233  break;
234  case 6:
235  m_decimatorsII.decimate64_cen(&it, buf, len);
236  break;
237  default:
238  break;
239  }
240 }
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 > m_decimatorsII
Definition: mainbench.h:71
SampleVector m_convertBuffer
Definition: mainbench.h:76
void decimate64_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:3040
void decimate2_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:554
void decimate8_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1057
uint32_t getLog2Factor() const
Definition: parserbench.h:48
void decimate4_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:782
const ParserBench & m_parser
Definition: mainbench.h:66
void decimate16_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1483
void decimate32_cen(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:2212
void decimate1(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:462
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decimateInfII()

void MainBench::decimateInfII ( const qint16 *  buf,
int  len 
)
private

Definition at line 242 of file mainbench.cpp.

References Decimators< StorageType, T, SdrBits, InputBits >::decimate1(), Decimators< StorageType, T, SdrBits, InputBits >::decimate16_inf(), Decimators< StorageType, T, SdrBits, InputBits >::decimate2_inf(), Decimators< StorageType, T, SdrBits, InputBits >::decimate32_inf(), Decimators< StorageType, T, SdrBits, InputBits >::decimate4_inf(), Decimators< StorageType, T, SdrBits, InputBits >::decimate64_inf(), Decimators< StorageType, T, SdrBits, InputBits >::decimate8_inf(), ParserBench::getLog2Factor(), m_convertBuffer, m_decimatorsII, and m_parser.

Referenced by testDecimateII().

243 {
244  SampleVector::iterator it = m_convertBuffer.begin();
245 
246  switch (m_parser.getLog2Factor())
247  {
248  case 0:
249  m_decimatorsII.decimate1(&it, buf, len);
250  break;
251  case 1:
252  m_decimatorsII.decimate2_inf(&it, buf, len);
253  break;
254  case 2:
255  m_decimatorsII.decimate4_inf(&it, buf, len);
256  break;
257  case 3:
258  m_decimatorsII.decimate8_inf(&it, buf, len);
259  break;
260  case 4:
261  m_decimatorsII.decimate16_inf(&it, buf, len);
262  break;
263  case 5:
264  m_decimatorsII.decimate32_inf(&it, buf, len);
265  break;
266  case 6:
267  m_decimatorsII.decimate64_inf(&it, buf, len);
268  break;
269  default:
270  break;
271  }
272 }
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 > m_decimatorsII
Definition: mainbench.h:71
SampleVector m_convertBuffer
Definition: mainbench.h:76
void decimate2_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:498
void decimate64_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:2418
void decimate32_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1592
uint32_t getLog2Factor() const
Definition: parserbench.h:48
void decimate8_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:825
void decimate4_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:582
const ParserBench & m_parser
Definition: mainbench.h:66
void decimate16_inf(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1117
void decimate1(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:462
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decimateSupII()

void MainBench::decimateSupII ( const qint16 *  buf,
int  len 
)
private

Definition at line 274 of file mainbench.cpp.

References Decimators< StorageType, T, SdrBits, InputBits >::decimate1(), Decimators< StorageType, T, SdrBits, InputBits >::decimate16_sup(), Decimators< StorageType, T, SdrBits, InputBits >::decimate2_sup(), Decimators< StorageType, T, SdrBits, InputBits >::decimate32_sup(), Decimators< StorageType, T, SdrBits, InputBits >::decimate4_sup(), Decimators< StorageType, T, SdrBits, InputBits >::decimate64_sup(), Decimators< StorageType, T, SdrBits, InputBits >::decimate8_sup(), ParserBench::getLog2Factor(), m_convertBuffer, m_decimatorsII, and m_parser.

Referenced by testDecimateII().

275 {
276  SampleVector::iterator it = m_convertBuffer.begin();
277 
278  switch (m_parser.getLog2Factor())
279  {
280  case 0:
281  m_decimatorsII.decimate1(&it, buf, len);
282  break;
283  case 1:
284  m_decimatorsII.decimate2_sup(&it, buf, len);
285  break;
286  case 2:
287  m_decimatorsII.decimate4_sup(&it, buf, len);
288  break;
289  case 3:
290  m_decimatorsII.decimate8_sup(&it, buf, len);
291  break;
292  case 4:
293  m_decimatorsII.decimate16_sup(&it, buf, len);
294  break;
295  case 5:
296  m_decimatorsII.decimate32_sup(&it, buf, len);
297  break;
298  case 6:
299  m_decimatorsII.decimate64_sup(&it, buf, len);
300  break;
301  default:
302  break;
303  }
304 }
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 > m_decimatorsII
Definition: mainbench.h:71
SampleVector m_convertBuffer
Definition: mainbench.h:76
void decimate64_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:2975
void decimate2_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:526
void decimate8_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:941
void decimate32_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1902
void decimate4_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:682
uint32_t getLog2Factor() const
Definition: parserbench.h:48
void decimate16_sup(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:1300
const ParserBench & m_parser
Definition: mainbench.h:66
void decimate1(SampleVector::iterator *it, const T *buf, qint32 len)
Definition: decimators.h:462
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finished

void MainBench::finished ( )
signal

Referenced by run().

+ Here is the caller graph for this function:

◆ printResults()

void MainBench::printResults ( const QString &  prefix,
qint64  nsecs 
)
private

Definition at line 402 of file mainbench.cpp.

References ParserBench::getNbSamples(), ParserBench::getRepetition(), and m_parser.

Referenced by testDecimateFF(), testDecimateFI(), testDecimateIF(), and testDecimateII().

403 {
404  double ratekSs = (m_parser.getNbSamples()*m_parser.getRepetition() / (double) nsecs) * 1e6;
405  QDebug info = qInfo();
406  info.noquote();
407  info << tr("%1: ran test in %L2 ns - sample rate: %3 kS/s").arg(prefix).arg(nsecs).arg(ratekSs);
408 }
uint32_t getRepetition() const
Definition: parserbench.h:47
uint32_t getNbSamples() const
Definition: parserbench.h:46
const ParserBench & m_parser
Definition: mainbench.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run

void MainBench::run ( )
slot

Definition at line 44 of file mainbench.cpp.

References finished(), ParserBench::getLog2Factor(), ParserBench::getNbSamples(), ParserBench::getRepetition(), ParserBench::getTestStr(), ParserBench::getTestType(), m_parser, ParserBench::TestAMBE, testAMBE(), testDecimateFF(), testDecimateFI(), testDecimateIF(), testDecimateII(), ParserBench::TestDecimatorsFF, ParserBench::TestDecimatorsFI, ParserBench::TestDecimatorsIF, ParserBench::TestDecimatorsII, ParserBench::TestDecimatorsInfII, and ParserBench::TestDecimatorsSupII.

45 {
46  qDebug() << "MainBench::run: parameters:"
47  << " testStr: " << m_parser.getTestStr()
48  << " testType: " << (int) m_parser.getTestType()
49  << " nsamples: " << m_parser.getNbSamples()
50  << " repet: " << m_parser.getRepetition()
51  << " log2f: " << m_parser.getLog2Factor();
52 
65  } else if (m_parser.getTestType() == ParserBench::TestAMBE) {
66  testAMBE();
67  } else {
68  qDebug() << "MainBench::run: unknown test type: " << m_parser.getTestType();
69  }
70 
71  emit finished();
72 }
uint32_t getRepetition() const
Definition: parserbench.h:47
void testDecimateII(ParserBench::TestType testType=ParserBench::TestDecimatorsII)
Definition: mainbench.cpp:74
uint32_t getLog2Factor() const
Definition: parserbench.h:48
void finished()
void testDecimateIF()
Definition: mainbench.cpp:117
const QString & getTestStr() const
Definition: parserbench.h:44
void testDecimateFF()
Definition: mainbench.cpp:171
void testDecimateFI()
Definition: mainbench.cpp:144
uint32_t getNbSamples() const
Definition: parserbench.h:46
void testAMBE()
Definition: mainbench.cpp:198
const ParserBench & m_parser
Definition: mainbench.h:66
TestType getTestType() const
+ Here is the call graph for this function:

◆ testAMBE()

void MainBench::testAMBE ( )
private

Definition at line 198 of file mainbench.cpp.

References AMBEEngine::scan().

Referenced by run().

199 {
200  qDebug() << "MainBench::testAMBE";
201  AMBEEngine ambeEngine;
202  std::vector<QString> ambeDevices;
203  ambeEngine.scan(ambeDevices);
204 
205  for (std::vector<QString>::const_iterator it = ambeDevices.begin(); it != ambeDevices.end(); ++it) {
206  qDebug("MainBench::testAMBE: detected AMBE device %s", qPrintable(*it));
207  }
208 }
void scan(std::vector< QString > &ambeDevices)
Definition: ambeengine.cpp:191
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testDecimateFF()

void MainBench::testDecimateFF ( )
private

Definition at line 171 of file mainbench.cpp.

References decimateFF(), ParserBench::getLog2Factor(), ParserBench::getNbSamples(), ParserBench::getRepetition(), i, m_convertBufferF, m_generator, m_parser, m_uniform_distribution_f, and printResults().

Referenced by run().

172 {
173  QElapsedTimer timer;
174  qint64 nsecs = 0;
175 
176  qDebug() << "MainBench::testDecimateFF: create test data";
177 
178  float *buf = new float[m_parser.getNbSamples()*2];
180  auto my_rand = std::bind(m_uniform_distribution_f, m_generator);
181  std::generate(buf, buf + m_parser.getNbSamples()*2 - 1, my_rand); // make sure data is in [-1.0..1.0] range
182 
183  qDebug() << "MainBench::testDecimateFF: run test";
184 
185  for (uint32_t i = 0; i < m_parser.getRepetition(); i++)
186  {
187  timer.start();
188  decimateFF(buf, m_parser.getNbSamples()*2);
189  nsecs += timer.nsecsElapsed();
190  }
191 
192  printResults("MainBench::testDecimateFF", nsecs);
193 
194  qDebug() << "MainBench::testDecimateFF: cleanup test data";
195  delete[] buf;
196 }
uint32_t getRepetition() const
Definition: parserbench.h:47
void decimateFF(const float *buf, int len)
Definition: mainbench.cpp:370
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint32_t getLog2Factor() const
Definition: parserbench.h:48
int32_t i
Definition: decimators.h:244
FSampleVector m_convertBufferF
Definition: mainbench.h:77
void printResults(const QString &prefix, qint64 nsecs)
Definition: mainbench.cpp:402
uint32_t getNbSamples() const
Definition: parserbench.h:46
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testDecimateFI()

void MainBench::testDecimateFI ( )
private

Definition at line 144 of file mainbench.cpp.

References decimateFI(), ParserBench::getLog2Factor(), ParserBench::getNbSamples(), ParserBench::getRepetition(), i, m_convertBuffer, m_generator, m_parser, m_uniform_distribution_f, and printResults().

Referenced by run().

145 {
146  QElapsedTimer timer;
147  qint64 nsecs = 0;
148 
149  qDebug() << "MainBench::testDecimateFI: create test data";
150 
151  float *buf = new float[m_parser.getNbSamples()*2];
153  auto my_rand = std::bind(m_uniform_distribution_f, m_generator);
154  std::generate(buf, buf + m_parser.getNbSamples()*2 - 1, my_rand); // make sure data is in [-1.0..1.0] range
155 
156  qDebug() << "MainBench::testDecimateFI: run test";
157 
158  for (uint32_t i = 0; i < m_parser.getRepetition(); i++)
159  {
160  timer.start();
161  decimateFI(buf, m_parser.getNbSamples()*2);
162  nsecs += timer.nsecsElapsed();
163  }
164 
165  printResults("MainBench::testDecimateFI", nsecs);
166 
167  qDebug() << "MainBench::testDecimateFI: cleanup test data";
168  delete[] buf;
169 }
SampleVector m_convertBuffer
Definition: mainbench.h:76
uint32_t getRepetition() const
Definition: parserbench.h:47
unsigned int uint32_t
Definition: rtptypes_win.h:46
void decimateFI(const float *buf, int len)
Definition: mainbench.cpp:338
uint32_t getLog2Factor() const
Definition: parserbench.h:48
int32_t i
Definition: decimators.h:244
void printResults(const QString &prefix, qint64 nsecs)
Definition: mainbench.cpp:402
uint32_t getNbSamples() const
Definition: parserbench.h:46
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testDecimateIF()

void MainBench::testDecimateIF ( )
private

Definition at line 117 of file mainbench.cpp.

References decimateIF(), ParserBench::getLog2Factor(), ParserBench::getNbSamples(), ParserBench::getRepetition(), i, m_convertBufferF, m_generator, m_parser, m_uniform_distribution_s16, and printResults().

Referenced by run().

118 {
119  QElapsedTimer timer;
120  qint64 nsecs = 0;
121 
122  qDebug() << "MainBench::testDecimateIF: create test data";
123 
124  qint16 *buf = new qint16[m_parser.getNbSamples()*2];
126  auto my_rand = std::bind(m_uniform_distribution_s16, m_generator);
127  std::generate(buf, buf + m_parser.getNbSamples()*2 - 1, my_rand);
128 
129  qDebug() << "MainBench::testDecimateIF: run test";
130 
131  for (uint32_t i = 0; i < m_parser.getRepetition(); i++)
132  {
133  timer.start();
134  decimateIF(buf, m_parser.getNbSamples()*2);
135  nsecs += timer.nsecsElapsed();
136  }
137 
138  printResults("MainBench::testDecimateIF", nsecs);
139 
140  qDebug() << "MainBench::testDecimateIF: cleanup test data";
141  delete[] buf;
142 }
uint32_t getRepetition() const
Definition: parserbench.h:47
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint32_t getLog2Factor() const
Definition: parserbench.h:48
std::uniform_int_distribution< qint16 > m_uniform_distribution_s16
Definition: mainbench.h:69
int32_t i
Definition: decimators.h:244
FSampleVector m_convertBufferF
Definition: mainbench.h:77
void printResults(const QString &prefix, qint64 nsecs)
Definition: mainbench.cpp:402
uint32_t getNbSamples() const
Definition: parserbench.h:46
void decimateIF(const qint16 *buf, int len)
Definition: mainbench.cpp:306
const ParserBench & m_parser
Definition: mainbench.h:66
std::mt19937 m_generator
Definition: mainbench.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testDecimateII()

void MainBench::testDecimateII ( ParserBench::TestType  testType = ParserBench::TestDecimatorsII)
private

Definition at line 74 of file mainbench.cpp.

References decimateII(), decimateInfII(), decimateSupII(), ParserBench::getLog2Factor(), ParserBench::getNbSamples(), ParserBench::getRepetition(), i, m_convertBuffer, m_generator, m_parser, m_uniform_distribution_s16, printResults(), ParserBench::TestDecimatorsII, ParserBench::TestDecimatorsInfII, and ParserBench::TestDecimatorsSupII.

Referenced by run().

75 {
76  QElapsedTimer timer;
77  qint64 nsecs = 0;
78 
79  qDebug() << "MainBench::testDecimateII: create test data";
80 
81  qint16 *buf = new qint16[m_parser.getNbSamples()*2];
83  auto my_rand = std::bind(m_uniform_distribution_s16, m_generator);
84  std::generate(buf, buf + m_parser.getNbSamples()*2 - 1, my_rand);
85 
86  qDebug() << "MainBench::testDecimateII: run test";
87 
88  for (uint32_t i = 0; i < m_parser.getRepetition(); i++)
89  {
90  switch (testType)
91  {
93  timer.start();
95  nsecs += timer.nsecsElapsed();
96  break;
98  timer.start();
100  nsecs += timer.nsecsElapsed();
101  break;
103  default:
104  timer.start();
105  decimateII(buf, m_parser.getNbSamples()*2);
106  nsecs += timer.nsecsElapsed();
107  break;
108  }
109  }
110 
111  printResults("MainBench::testDecimateII", nsecs);
112 
113  qDebug() << "MainBench::testDecimateII: cleanup test data";
114  delete[] buf;
115 }
SampleVector m_convertBuffer
Definition: mainbench.h:76
uint32_t getRepetition() const
Definition: parserbench.h:47
void decimateSupII(const qint16 *buf, int len)
Definition: mainbench.cpp:274
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint32_t getLog2Factor() const
Definition: parserbench.h:48
std::uniform_int_distribution< qint16 > m_uniform_distribution_s16
Definition: mainbench.h:69
int32_t i
Definition: decimators.h:244
void printResults(const QString &prefix, qint64 nsecs)
Definition: mainbench.cpp:402
void decimateII(const qint16 *buf, int len)
Definition: mainbench.cpp:210
void decimateInfII(const qint16 *buf, int len)
Definition: mainbench.cpp:242
uint32_t getNbSamples() const
Definition: parserbench.h:46
const ParserBench & m_parser
Definition: mainbench.h:66
std::mt19937 m_generator
Definition: mainbench.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_convertBuffer

SampleVector MainBench::m_convertBuffer
private

◆ m_convertBufferF

FSampleVector MainBench::m_convertBufferF
private

Definition at line 77 of file mainbench.h.

Referenced by decimateFF(), decimateIF(), testDecimateFF(), and testDecimateIF().

◆ m_decimatorsFF

DecimatorsFF MainBench::m_decimatorsFF
private

Definition at line 74 of file mainbench.h.

Referenced by decimateFF().

◆ m_decimatorsFI

DecimatorsFI MainBench::m_decimatorsFI
private

Definition at line 73 of file mainbench.h.

Referenced by decimateFI().

◆ m_decimatorsIF

DecimatorsIF<qint16, 12> MainBench::m_decimatorsIF
private

Definition at line 72 of file mainbench.h.

Referenced by decimateIF().

◆ m_decimatorsII

Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> MainBench::m_decimatorsII
private

Definition at line 71 of file mainbench.h.

Referenced by decimateII(), decimateInfII(), and decimateSupII().

◆ m_generator

std::mt19937 MainBench::m_generator
private

Definition at line 67 of file mainbench.h.

Referenced by testDecimateFF(), testDecimateFI(), testDecimateIF(), and testDecimateII().

◆ m_instance

MainBench * MainBench::m_instance = 0
staticprivate

Definition at line 64 of file mainbench.h.

Referenced by MainBench().

◆ m_logger

qtwebapp::LoggerWithFile* MainBench::m_logger
private

Definition at line 65 of file mainbench.h.

◆ m_parser

const ParserBench& MainBench::m_parser
private

◆ m_uniform_distribution_f

std::uniform_real_distribution<float> MainBench::m_uniform_distribution_f
private

Definition at line 68 of file mainbench.h.

Referenced by testDecimateFF(), and testDecimateFI().

◆ m_uniform_distribution_s16

std::uniform_int_distribution<qint16> MainBench::m_uniform_distribution_s16
private

Definition at line 69 of file mainbench.h.

Referenced by testDecimateIF(), and testDecimateII().


The documentation for this class was generated from the following files: