Move gran() to Modulator implementation file

This function is used only by the Modulator, and even then, only when testing.
This commit is contained in:
Allan Bazinet 2024-10-27 16:10:13 -07:00
parent 5d90376271
commit b60e019874
4 changed files with 12 additions and 22 deletions

View file

@ -210,7 +210,6 @@ set (wsjtx_CXXSRCS
Detector.cpp
logqso.cpp
decodedtext.cpp
getfile.cpp
soundout.cpp
soundin.cpp
signalmeter.cpp

View file

@ -2,6 +2,7 @@
#include <algorithm>
#include <cmath>
#include <limits>
#include <random>
#include <QDateTime>
#include <QDebug>
#include <QRandomGenerator>
@ -13,12 +14,20 @@
#include "moc_Modulator.cpp"
extern float gran(); // Noise generator (for tests only)
namespace
{
constexpr double TAU = 2 * M_PI;
// Noise generator, for tests only; generate gaussian random
// float with mean = 0 and std_dev = 1.
float
gran()
{
static std::normal_distribution<float> d;
return d(*QRandomGenerator::global());
}
unsigned
delayMS(qint32 const trPeriod)
{

View file

@ -1,10 +0,0 @@
#include "getfile.h"
#include <random>
#include <QRandomGenerator>
/* Generate gaussian random float with mean=0 and std_dev=1 */
float gran()
{
static std::normal_distribution<float> d;
return d (*QRandomGenerator::global ());
}

View file

@ -1,8 +0,0 @@
// -*- Mode: C++ -*-
#ifndef GETFILE_H
#define GETFILE_H
#include <QDebug>
float gran();
#endif // GETFILE_H