1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

Various small corrections

This commit is contained in:
f4exb 2017-11-06 02:12:44 +01:00
parent 95f9df8396
commit 3d74ac9ed8
9 changed files with 145 additions and 192 deletions

View File

@ -126,19 +126,14 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
for (SampleVector::const_iterator it = begin; it != end; ++it)
{
//Complex c(it->real() / 32768.0f, it->imag() / 32768.0f);
Complex c(it->real(), it->imag());
c *= m_nco.nextIQ();
{
if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci))
{
qint16 sample;
//m_AGC.feed(ci);
//double magsqRaw = m_AGC.getMagSq();
double magsqRaw; // = ci.real()*ci.real() + c.imag()*c.imag();
Real deviation;
@ -154,9 +149,6 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
}
m_magsqCount++;
//m_m2Sample = m_m1Sample;
//m_m1Sample = ci;
m_sampleCount++;
// AF processing
@ -200,33 +192,9 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
}
}
// if ( (m_settings.m_deltaSquelch && ((deviation > m_squelchLevel) || (deviation < -m_squelchLevel))) ||
// (!m_settings.m_deltaSquelch && (m_movingAverage.average() < m_squelchLevel)) )
// {
// if (m_squelchCount > 0)
// {
// m_squelchCount--;
// }
// }
// else
// {
// if (m_squelchCount < m_squelchGate + 480)
// {
// m_squelchCount++;
// }
// }
//squelchOpen = (getMag() > m_squelchLevel);
m_squelchOpen = (m_squelchCount > m_squelchGate);
/*
if (m_afSquelch.analyze(demod))
{
squelchOpen = m_afSquelch.evaluate();
}*/
if ((m_squelchOpen) && !m_settings.m_audioMute)
//if (m_AGC.getAverage() > m_squelchLevel)
{
if (m_settings.m_ctcssOn)
{
@ -312,7 +280,6 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
m_interpolatorDistanceRemain += m_interpolatorDistance;
}
}
}
if (m_audioBufferFill > 0)
{
@ -414,17 +381,18 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force)
}
if ((settings.m_inputSampleRate != m_settings.m_inputSampleRate) ||
(settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force)
(settings.m_rfBandwidth != m_settings.m_rfBandwidth) ||
(settings.m_audioSampleRate != m_settings.m_audioSampleRate) || force)
{
m_settingsMutex.lock();
m_interpolator.create(16, settings.m_inputSampleRate, settings.m_rfBandwidth / 2.2);
m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) settings.m_inputSampleRate / (Real) settings.m_audioSampleRate;
m_phaseDiscri.setFMScaling((8.0f*settings.m_rfBandwidth) / (float) settings.m_fmDeviation); // integrate 4x factor
m_settingsMutex.unlock();
}
if ((settings.m_fmDeviation != m_settings.m_fmDeviation) || force)
if ((settings.m_fmDeviation != m_settings.m_fmDeviation) ||
(settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force)
{
m_phaseDiscri.setFMScaling((8.0f*settings.m_rfBandwidth) / (float) settings.m_fmDeviation); // integrate 4x factor
}
@ -460,8 +428,6 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force)
}
m_squelchCount = 0; // reset squelch open counter
//m_squelchLevel *= m_squelchLevel;
//m_afSquelch.setThreshold(m_squelchLevel);
}
if ((settings.m_udpAddress != m_settings.m_udpAddress)

View File

@ -271,15 +271,8 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, QWidget
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
//m_channelMarker = new ChannelMarker(this);
// m_channelMarker.setColor(Qt::red);
// m_channelMarker.setBandwidth(12500);
// m_channelMarker.setCenterFrequency(0);
m_channelMarker.setVisible(true);
m_channelMarker.setTitle("NFM Demodulator");
// m_channelMarker.setUDPAddress("127.0.0.1");
// m_channelMarker.setUDPSendPort(9999);
// setTitleColor(m_channelMarker.getColor());
m_settings.setChannelMarker(&m_channelMarker);
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged()));
@ -301,7 +294,6 @@ NFMDemodGUI::~NFMDemodGUI()
{
m_deviceUISet->removeRxChannelInstance(this);
delete m_nfmDemod;
//delete m_channelMarker;
delete ui;
}

View File

@ -417,7 +417,8 @@ void NFMMod::applySettings(const NFMModSettings& settings, bool force)
}
if((settings.m_outputSampleRate != m_settings.m_outputSampleRate) ||
(settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force)
(settings.m_rfBandwidth != m_settings.m_rfBandwidth) ||
(settings.m_audioSampleRate != m_settings.m_audioSampleRate) || force)
{
m_settingsMutex.lock();
m_interpolatorDistanceRemain = 0;

View File

@ -23,7 +23,7 @@
const PluginDescriptor NFMModPlugin::m_pluginDescriptor = {
QString("NFM Modulator"),
QString("3.8.0"),
QString("3.8.2"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -254,14 +254,10 @@ bool BladerfInput::applySettings(const BladeRFInputSettings& settings, bool forc
qDebug() << "BladerfInput::applySettings: m_dev: " << m_dev;
if (m_settings.m_dcBlock != settings.m_dcBlock)
if ((m_settings.m_dcBlock != settings.m_dcBlock) ||
(m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
{
m_settings.m_dcBlock = settings.m_dcBlock;
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
}
if (m_settings.m_iqCorrection != settings.m_iqCorrection)
{
m_settings.m_iqCorrection = settings.m_iqCorrection;
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
}

View File

@ -62,6 +62,8 @@ BladerfInputGui::BladerfInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
displaySettings();
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
sendSettings();
}
BladerfInputGui::~BladerfInputGui()

View File

@ -27,7 +27,7 @@
const PluginDescriptor BlderfInputPlugin::m_pluginDescriptor = {
QString("BladerRF Input"),
QString("3.8.0"),
QString("3.8.2"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -255,14 +255,10 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force)
qDebug() << "HackRFInput::applySettings";
if (m_settings.m_dcBlock != settings.m_dcBlock)
if ((m_settings.m_dcBlock != settings.m_dcBlock) ||
(m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
{
m_settings.m_dcBlock = settings.m_dcBlock;
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
}
if (m_settings.m_iqCorrection != settings.m_iqCorrection)
{
m_settings.m_iqCorrection = settings.m_iqCorrection;
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
}

View File

@ -29,7 +29,7 @@
const PluginDescriptor HackRFInputPlugin::m_pluginDescriptor = {
QString("HackRF Input"),
QString("3.8.0"),
QString("3.8.2"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,