1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04: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 sdrangel (4.0.6-1) unstable; urgency=medium
* Web API: RTL-SDR: fixed RF bandwidth setting * 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 sdrangel (4.0.5-1) unstable; urgency=medium

View File

@ -127,9 +127,17 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples) void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{ {
avg = m_magsqCount == 0 ? 1e-10 : m_magsqSum / m_magsqCount; if (m_magsqCount > 0)
peak = m_magsqPeak == 0.0 ? 1e-10 : m_magsqPeak; {
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; nbSamples = m_magsqCount == 0 ? 1 : m_magsqCount;
m_magsqSum = 0.0f; m_magsqSum = 0.0f;
m_magsqPeak = 0.0f; m_magsqPeak = 0.0f;
m_magsqCount = 0; m_magsqCount = 0;
@ -139,6 +147,16 @@ public:
static const QString m_channelId; static const QString m_channelId;
private: private:
struct MagSqLevelsStore
{
MagSqLevelsStore() :
m_magsq(1e-12),
m_magsqPeak(1e-12)
{}
double m_magsq;
double m_magsqPeak;
};
enum RateState { enum RateState {
RSInitialFill, RSInitialFill,
RSRunning RSRunning
@ -167,6 +185,7 @@ private:
double m_magsqSum; double m_magsqSum;
double m_magsqPeak; double m_magsqPeak;
int m_magsqCount; int m_magsqCount;
MagSqLevelsStore m_magSqLevelStore;
MovingAverageUtil<Real, double, 16> m_movingAverage; MovingAverageUtil<Real, double, 16> m_movingAverage;
SimpleAGC<4800> m_volumeAGC; SimpleAGC<4800> m_volumeAGC;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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