UDP source plugin: new AM mode with 300 Hz low cutoff bandpass filter

This commit is contained in:
f4exb 2017-08-20 22:18:33 +02:00
parent 7cfdb9efdd
commit 8a16e99e48
4 changed files with 31 additions and 0 deletions

View File

@ -286,6 +286,23 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
m_udpBufferMono->write(0);
m_outMovingAverage.feed(0);
}
}
else if (m_running.m_sampleFormat == FormatAMBPFMono)
{
if (m_squelchOpen)
{
double demodf = sqrt(inMagSq);
demodf = m_bandpass.filter(demodf);
demodf /= 301.0;
FixReal demod = (FixReal) (demodf * agcFactor * m_running.m_gain);
m_udpBufferMono->write(demod);
m_outMovingAverage.feed((demod * demod) / 1073741824.0);
}
else
{
m_udpBufferMono->write(0);
m_outMovingAverage.feed(0);
}
}
else // Raw I/Q samples
{
@ -437,6 +454,8 @@ void UDPSrc::apply(bool force)
m_agc.setStepDownDelay( m_config.m_outputSampleRate * (m_config.m_squelchGate == 0 ? 0.01 : m_config.m_squelchGate));
m_agc.setGate(m_config.m_outputSampleRate * 0.02);
m_bandpass.create(301, m_config.m_outputSampleRate, 300.0, m_config.m_rfBandwidth / 2.0f);
m_inMovingAverage.resize(m_config.m_outputSampleRate * 0.01, 1e-10); // 10 ms
m_amMovingAverage.resize(m_config.m_outputSampleRate * 0.005, 1e-10); // 5 ms
m_outMovingAverage.resize(m_config.m_outputSampleRate * 0.01, 1e-10); // 10 ms

View File

@ -27,6 +27,7 @@
#include "dsp/phasediscri.h"
#include "dsp/movingaverage.h"
#include "dsp/agc.h"
#include "dsp/bandpass.h"
#include "util/udpsink.h"
#include "util/message.h"
#include "audio/audiofifo.h"
@ -49,6 +50,7 @@ public:
FormatUSBMono,
FormatAMMono,
FormatAMNoDCMono,
FormatAMBPFMono,
FormatNone
};
@ -341,6 +343,7 @@ protected:
int m_squelchThreshold; //!< number of samples computed from given gate
MagAGC m_agc;
Bandpass<double> m_bandpass;
QMutex m_settingsMutex;

View File

@ -453,6 +453,10 @@ void UDPSrcGUI::applySettings(bool force)
case 8:
sampleFormat = UDPSrc::FormatAMNoDCMono;
ui->fmDeviation->setEnabled(false);
break;
case 9:
sampleFormat = UDPSrc::FormatAMBPFMono;
ui->fmDeviation->setEnabled(false);
break;
default:
sampleFormat = UDPSrc::FormatS16LE;

View File

@ -522,6 +522,11 @@
<string>S16LE AM !DC Mono</string>
</property>
</item>
<item>
<property name="text">
<string>S16LE AM BPF Mono</string>
</property>
</item>
</widget>
</item>
</layout>