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:
parent
95f9df8396
commit
3d74ac9ed8
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ BladerfInputGui::BladerfInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
displaySettings();
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
BladerfInputGui::~BladerfInputGui()
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user