mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-10-01 09:16:39 -04:00
UDP source plugin: new AM mode with 300 Hz low cutoff bandpass filter
This commit is contained in:
parent
7cfdb9efdd
commit
8a16e99e48
@ -286,6 +286,23 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
|
|||||||
m_udpBufferMono->write(0);
|
m_udpBufferMono->write(0);
|
||||||
m_outMovingAverage.feed(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
|
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.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_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_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_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
|
m_outMovingAverage.resize(m_config.m_outputSampleRate * 0.01, 1e-10); // 10 ms
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "dsp/phasediscri.h"
|
#include "dsp/phasediscri.h"
|
||||||
#include "dsp/movingaverage.h"
|
#include "dsp/movingaverage.h"
|
||||||
#include "dsp/agc.h"
|
#include "dsp/agc.h"
|
||||||
|
#include "dsp/bandpass.h"
|
||||||
#include "util/udpsink.h"
|
#include "util/udpsink.h"
|
||||||
#include "util/message.h"
|
#include "util/message.h"
|
||||||
#include "audio/audiofifo.h"
|
#include "audio/audiofifo.h"
|
||||||
@ -49,6 +50,7 @@ public:
|
|||||||
FormatUSBMono,
|
FormatUSBMono,
|
||||||
FormatAMMono,
|
FormatAMMono,
|
||||||
FormatAMNoDCMono,
|
FormatAMNoDCMono,
|
||||||
|
FormatAMBPFMono,
|
||||||
FormatNone
|
FormatNone
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -341,6 +343,7 @@ protected:
|
|||||||
int m_squelchThreshold; //!< number of samples computed from given gate
|
int m_squelchThreshold; //!< number of samples computed from given gate
|
||||||
|
|
||||||
MagAGC m_agc;
|
MagAGC m_agc;
|
||||||
|
Bandpass<double> m_bandpass;
|
||||||
|
|
||||||
QMutex m_settingsMutex;
|
QMutex m_settingsMutex;
|
||||||
|
|
||||||
|
@ -453,6 +453,10 @@ void UDPSrcGUI::applySettings(bool force)
|
|||||||
case 8:
|
case 8:
|
||||||
sampleFormat = UDPSrc::FormatAMNoDCMono;
|
sampleFormat = UDPSrc::FormatAMNoDCMono;
|
||||||
ui->fmDeviation->setEnabled(false);
|
ui->fmDeviation->setEnabled(false);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
sampleFormat = UDPSrc::FormatAMBPFMono;
|
||||||
|
ui->fmDeviation->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sampleFormat = UDPSrc::FormatS16LE;
|
sampleFormat = UDPSrc::FormatS16LE;
|
||||||
|
@ -522,6 +522,11 @@
|
|||||||
<string>S16LE AM !DC Mono</string>
|
<string>S16LE AM !DC Mono</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>S16LE AM BPF Mono</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user