1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

Fixed power display going to floor value in some demods

This commit is contained in:
f4exb 2018-08-05 12:44:06 +02:00
parent e783bcbbcb
commit f368c62329
12 changed files with 139 additions and 29 deletions

5
debian/changelog vendored
View File

@ -1,9 +1,10 @@
sdrangel (4.0.6-1) unstable; urgency=medium
* Web API: RTL-SDR: fixed RF bandwidth setting
* Web API: enhnaced DV serial and AM demod interfaces
* Web API: enhanced DV serial and AM demod interfaces
* Fixed power display going to floor value in some demods
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 05 Aug 2018 09:14:18 +0200
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 05 Aug 2018 19:14:18 +0200
sdrangel (4.0.5-1) unstable; urgency=medium

View File

@ -125,20 +125,38 @@ public:
bool getPllLocked() const { return m_settings.m_pll && m_pll.locked(); }
Real getPllFrequency() const { return m_pll.getFreq(); }
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{
avg = m_magsqCount == 0 ? 1e-10 : m_magsqSum / m_magsqCount;
peak = m_magsqPeak == 0.0 ? 1e-10 : m_magsqPeak;
nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
m_magsqSum = 0.0f;
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{
if (m_magsqCount > 0)
{
m_magsq = m_magsqSum / m_magsqCount;
m_magSqLevelStore.m_magsq = m_magsq;
m_magSqLevelStore.m_magsqPeak = m_magsqPeak;
}
avg = m_magSqLevelStore.m_magsq;
peak = m_magSqLevelStore.m_magsqPeak;
nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
m_magsqSum = 0.0f;
m_magsqPeak = 0.0f;
m_magsqCount = 0;
}
}
static const QString m_channelIdURI;
static const QString m_channelId;
private:
struct MagSqLevelsStore
{
MagSqLevelsStore() :
m_magsq(1e-12),
m_magsqPeak(1e-12)
{}
double m_magsq;
double m_magsqPeak;
};
enum RateState {
RSInitialFill,
RSRunning
@ -167,6 +185,7 @@ private:
double m_magsqSum;
double m_magsqPeak;
int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
MovingAverageUtil<Real, double, 16> m_movingAverage;
SimpleAGC<4800> m_volumeAGC;

View File

@ -146,10 +146,17 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{
avg = m_magsqCount == 0 ? 1e-10 : m_magsqSum / m_magsqCount;
m_magsq = avg;
peak = m_magsqPeak == 0.0 ? 1e-10 : m_magsqPeak;
if (m_magsqCount > 0)
{
m_magsq = m_magsqSum / m_magsqCount;
m_magSqLevelStore.m_magsq = m_magsq;
m_magSqLevelStore.m_magsqPeak = m_magsqPeak;
}
avg = m_magSqLevelStore.m_magsq;
peak = m_magSqLevelStore.m_magsqPeak;
nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
m_magsqSum = 0.0f;
m_magsqPeak = 0.0f;
m_magsqCount = 0;
@ -184,6 +191,16 @@ public:
static const QString m_channelId;
private:
struct MagSqLevelsStore
{
MagSqLevelsStore() :
m_magsq(1e-12),
m_magsqPeak(1e-12)
{}
double m_magsq;
double m_magsqPeak;
};
enum RateState {
RSInitialFill,
RSRunning
@ -224,6 +241,7 @@ private:
double m_magsqSum;
double m_magsqPeak;
int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
AudioVector m_audioBuffer;
uint m_audioBufferFill;

View File

@ -27,7 +27,7 @@
const PluginDescriptor BFMPlugin::m_pluginDescriptor = {
QString("Broadcast FM Demodulator"),
QString("4.0.2"),
QString("4.0.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -117,10 +117,17 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{
avg = m_magsqCount == 0 ? 1e-10 : m_magsqSum / m_magsqCount;
m_magsq = avg;
peak = m_magsqPeak == 0.0 ? 1e-10 : m_magsqPeak;
if (m_magsqCount > 0)
{
m_magsq = m_magsqSum / m_magsqCount;
m_magSqLevelStore.m_magsq = m_magsq;
m_magSqLevelStore.m_magsqPeak = m_magsqPeak;
}
avg = m_magSqLevelStore.m_magsq;
peak = m_magSqLevelStore.m_magsqPeak;
nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
m_magsqSum = 0.0f;
m_magsqPeak = 0.0f;
m_magsqCount = 0;
@ -146,6 +153,16 @@ public:
static const QString m_channelId;
private:
struct MagSqLevelsStore
{
MagSqLevelsStore() :
m_magsq(1e-12),
m_magsqPeak(1e-12)
{}
double m_magsq;
double m_magsqPeak;
};
typedef enum
{
signalFormatNone,
@ -208,6 +225,7 @@ private:
double m_magsqSum;
double m_magsqPeak;
int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
SampleVector m_scopeSampleBuffer;
AudioVector m_audioBuffer;

View File

@ -27,7 +27,7 @@
const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = {
QString("DSD Demodulator"),
QString("4.0.1"),
QString("4.0.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -154,10 +154,17 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{
avg = m_magsqCount == 0 ? 1e-10 : m_magsqSum / m_magsqCount;
m_magsq = avg;
peak = m_magsqPeak == 0.0 ? 1e-10 : m_magsqPeak;
if (m_magsqCount > 0)
{
m_magsq = m_magsqSum / m_magsqCount;
m_magSqLevelStore.m_magsq = m_magsq;
m_magSqLevelStore.m_magsqPeak = m_magsqPeak;
}
avg = m_magSqLevelStore.m_magsq;
peak = m_magSqLevelStore.m_magsqPeak;
nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
m_magsqSum = 0.0f;
m_magsqPeak = 0.0f;
m_magsqCount = 0;
@ -167,6 +174,16 @@ public:
static const QString m_channelId;
private:
struct MagSqLevelsStore
{
MagSqLevelsStore() :
m_magsq(1e-12),
m_magsqPeak(1e-12)
{}
double m_magsq;
double m_magsqPeak;
};
enum RateState {
RSInitialFill,
RSRunning
@ -203,6 +220,7 @@ private:
double m_magsqSum;
double m_magsqPeak;
int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
MovingAverageUtil<Real, double, 32> m_movingAverage;
AFSquelch m_afSquelch;

View File

@ -9,7 +9,7 @@
const PluginDescriptor NFMPlugin::m_pluginDescriptor = {
QString("NFM Demodulator"),
QString("3.14.6"),
QString("4.0.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -126,10 +126,17 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{
avg = m_magsqCount == 0 ? 1e-10 : m_magsqSum / m_magsqCount;
m_magsq = avg;
peak = m_magsqPeak == 0.0 ? 1e-10 : m_magsqPeak;
if (m_magsqCount > 0)
{
m_magsq = m_magsqSum / m_magsqCount;
m_magSqLevelStore.m_magsq = m_magsq;
m_magSqLevelStore.m_magsqPeak = m_magsqPeak;
}
avg = m_magSqLevelStore.m_magsq;
peak = m_magSqLevelStore.m_magsqPeak;
nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
m_magsqSum = 0.0f;
m_magsqPeak = 0.0f;
m_magsqCount = 0;
@ -153,6 +160,16 @@ public:
static const QString m_channelId;
private:
struct MagSqLevelsStore
{
MagSqLevelsStore() :
m_magsq(1e-12),
m_magsqPeak(1e-12)
{}
double m_magsq;
double m_magsqPeak;
};
class MsgConfigureSSBDemodPrivate : public Message {
MESSAGE_CLASS_DECLARATION
@ -268,6 +285,7 @@ private:
double m_magsqSum;
double m_magsqPeak;
int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
MagAGC m_agc;
bool m_agcActive;
bool m_agcClamping;

View File

@ -10,7 +10,7 @@
const PluginDescriptor SSBPlugin::m_pluginDescriptor = {
QString("SSB Demodulator"),
QString("4.0.2"),
QString("4.0.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -109,10 +109,17 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{
avg = m_magsqCount == 0 ? 1e-10 : m_magsqSum / m_magsqCount;
m_magsq = avg;
peak = m_magsqPeak == 0.0 ? 1e-10 : m_magsqPeak;
if (m_magsqCount > 0)
{
m_magsq = m_magsqSum / m_magsqCount;
m_magSqLevelStore.m_magsq = m_magsq;
m_magSqLevelStore.m_magsqPeak = m_magsqPeak;
}
avg = m_magSqLevelStore.m_magsq;
peak = m_magSqLevelStore.m_magsqPeak;
nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
m_magsqSum = 0.0f;
m_magsqPeak = 0.0f;
m_magsqCount = 0;
@ -145,6 +152,16 @@ public:
static const QString m_channelId;
private:
struct MagSqLevelsStore
{
MagSqLevelsStore() :
m_magsq(1e-12),
m_magsqPeak(1e-12)
{}
double m_magsq;
double m_magsqPeak;
};
enum RateState {
RSInitialFill,
RSRunning
@ -172,6 +189,7 @@ private:
double m_magsqSum;
double m_magsqPeak;
int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
MovingAverageUtil<Real, double, 16> m_movingAverage;
Real m_fmExcursion;

View File

@ -10,7 +10,7 @@
const PluginDescriptor WFMPlugin::m_pluginDescriptor = {
QString("WFM Demodulator"),
QString("4.0.0"),
QString("4.0.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,