1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 15:26:33 -04:00

Channel Analyzer NG: implemented PLL with PSK order

This commit is contained in:
Edouard Griffiths 2018-05-14 20:47:23 +02:00
parent 68c50769fe
commit 06c9f7f20d
5 changed files with 73 additions and 10 deletions

View File

@ -75,9 +75,10 @@ void ChannelAnalyzerNG::configure(MessageQueue* messageQueue,
Real LowCutoff, Real LowCutoff,
int spanLog2, int spanLog2,
bool ssb, bool ssb,
bool pll) bool pll,
unsigned int pllPskOrder)
{ {
Message* cmd = MsgConfigureChannelAnalyzer::create(channelSampleRate, Bandwidth, LowCutoff, spanLog2, ssb, pll); Message* cmd = MsgConfigureChannelAnalyzer::create(channelSampleRate, Bandwidth, LowCutoff, spanLog2, ssb, pll, pllPskOrder);
messageQueue->push(cmd); messageQueue->push(cmd);
} }
@ -168,6 +169,7 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
m_config.m_spanLog2 = cfg.getSpanLog2(); m_config.m_spanLog2 = cfg.getSpanLog2();
m_config.m_ssb = cfg.getSSB(); m_config.m_ssb = cfg.getSSB();
m_config.m_pll = cfg.getPLL(); m_config.m_pll = cfg.getPLL();
m_config.m_pllPskOrder = cfg.getPLLPSKOrder();
qDebug() << "ChannelAnalyzerNG::handleMessage: MsgConfigureChannelAnalyzer:" qDebug() << "ChannelAnalyzerNG::handleMessage: MsgConfigureChannelAnalyzer:"
<< " m_channelSampleRate: " << m_config.m_channelSampleRate << " m_channelSampleRate: " << m_config.m_channelSampleRate
@ -175,7 +177,8 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
<< " m_LowCutoff: " << m_config.m_LowCutoff << " m_LowCutoff: " << m_config.m_LowCutoff
<< " m_spanLog2: " << m_config.m_spanLog2 << " m_spanLog2: " << m_config.m_spanLog2
<< " m_ssb: " << m_config.m_ssb << " m_ssb: " << m_config.m_ssb
<< " m_pll: " << m_config.m_pll; << " m_pll: " << m_config.m_pll
<< " m_pllPskOrder: " << m_config.m_pllPskOrder;
apply(); apply();
return true; return true;
@ -256,6 +259,11 @@ void ChannelAnalyzerNG::apply(bool force)
} }
} }
if (m_running.m_pll != m_config.m_pll || force)
{
m_pll.setPskOrder(m_config.m_pllPskOrder);
}
m_running.m_frequency = m_config.m_frequency; m_running.m_frequency = m_config.m_frequency;
m_running.m_channelSampleRate = m_config.m_channelSampleRate; m_running.m_channelSampleRate = m_config.m_channelSampleRate;
m_running.m_inputSampleRate = m_config.m_inputSampleRate; m_running.m_inputSampleRate = m_config.m_inputSampleRate;
@ -266,5 +274,6 @@ void ChannelAnalyzerNG::apply(bool force)
m_running.m_spanLog2 = m_config.m_spanLog2; m_running.m_spanLog2 = m_config.m_spanLog2;
m_running.m_ssb = m_config.m_ssb; m_running.m_ssb = m_config.m_ssb;
m_running.m_pll = m_config.m_pll; m_running.m_pll = m_config.m_pll;
m_running.m_pllPskOrder = m_config.m_pllPskOrder;
//m_settingsMutex.unlock(); //m_settingsMutex.unlock();
} }

View File

@ -47,6 +47,7 @@ public:
int getSpanLog2() const { return m_spanLog2; } int getSpanLog2() const { return m_spanLog2; }
bool getSSB() const { return m_ssb; } bool getSSB() const { return m_ssb; }
bool getPLL() const { return m_pll; } bool getPLL() const { return m_pll; }
unsigned int getPLLPSKOrder() const { return m_pllPskOrder; }
static MsgConfigureChannelAnalyzer* create( static MsgConfigureChannelAnalyzer* create(
int channelSampleRate, int channelSampleRate,
@ -54,7 +55,8 @@ public:
Real LowCutoff, Real LowCutoff,
int spanLog2, int spanLog2,
bool ssb, bool ssb,
bool pll) bool pll,
unsigned int pllPskOrder)
{ {
return new MsgConfigureChannelAnalyzer( return new MsgConfigureChannelAnalyzer(
channelSampleRate, channelSampleRate,
@ -62,7 +64,8 @@ public:
LowCutoff, LowCutoff,
spanLog2, spanLog2,
ssb, ssb,
pll); pll,
pllPskOrder);
} }
private: private:
@ -72,6 +75,7 @@ public:
int m_spanLog2; int m_spanLog2;
bool m_ssb; bool m_ssb;
bool m_pll; bool m_pll;
unsigned int m_pllPskOrder;
MsgConfigureChannelAnalyzer( MsgConfigureChannelAnalyzer(
int channelSampleRate, int channelSampleRate,
@ -79,14 +83,16 @@ public:
Real LowCutoff, Real LowCutoff,
int spanLog2, int spanLog2,
bool ssb, bool ssb,
bool pll) : bool pll,
unsigned int pllPskOrder) :
Message(), Message(),
m_channelSampleRate(channelSampleRate), m_channelSampleRate(channelSampleRate),
m_Bandwidth(Bandwidth), m_Bandwidth(Bandwidth),
m_LowCutoff(LowCutoff), m_LowCutoff(LowCutoff),
m_spanLog2(spanLog2), m_spanLog2(spanLog2),
m_ssb(ssb), m_ssb(ssb),
m_pll(pll) m_pll(pll),
m_pllPskOrder(pllPskOrder)
{ } { }
}; };
@ -141,7 +147,8 @@ public:
Real LowCutoff, Real LowCutoff,
int spanLog2, int spanLog2,
bool ssb, bool ssb,
bool pll); bool pll,
unsigned int pllPskOrder);
DownChannelizer *getChannelizer() { return m_channelizer; } DownChannelizer *getChannelizer() { return m_channelizer; }
int getInputSampleRate() const { return m_running.m_inputSampleRate; } int getInputSampleRate() const { return m_running.m_inputSampleRate; }
@ -179,6 +186,7 @@ private:
int m_spanLog2; int m_spanLog2;
bool m_ssb; bool m_ssb;
bool m_pll; bool m_pll;
unsigned int m_pllPskOrder;
Config() : Config() :
m_frequency(0), m_frequency(0),
@ -188,7 +196,8 @@ private:
m_LowCutoff(300), m_LowCutoff(300),
m_spanLog2(3), m_spanLog2(3),
m_ssb(false), m_ssb(false),
m_pll(false) m_pll(false),
m_pllPskOrder(1)
{} {}
}; };

View File

@ -276,6 +276,11 @@ void ChannelAnalyzerNGGUI::on_pll_toggled(bool checked)
applySettings(); applySettings();
} }
void ChannelAnalyzerNGGUI::on_pllPskOrder_currentIndexChanged(int index __attribute__((unused)))
{
applySettings();
}
void ChannelAnalyzerNGGUI::on_useRationalDownsampler_toggled(bool checked __attribute__((unused))) void ChannelAnalyzerNGGUI::on_useRationalDownsampler_toggled(bool checked __attribute__((unused)))
{ {
setNewFinalRate(m_spanLog2); setNewFinalRate(m_spanLog2);
@ -605,7 +610,8 @@ void ChannelAnalyzerNGGUI::applySettings()
ui->lowCut->value() * 100.0, ui->lowCut->value() * 100.0,
m_spanLog2, m_spanLog2,
ui->ssb->isChecked(), ui->ssb->isChecked(),
ui->pll->isChecked()); ui->pll->isChecked(),
1<<ui->pllPskOrder->currentIndex());
} }
} }

View File

@ -94,6 +94,7 @@ private slots:
void on_deltaFrequency_changed(qint64 value); void on_deltaFrequency_changed(qint64 value);
void on_channelSampleRate_changed(quint64 value); void on_channelSampleRate_changed(quint64 value);
void on_pll_toggled(bool checked); void on_pll_toggled(bool checked);
void on_pllPskOrder_currentIndexChanged(int index);
void on_useRationalDownsampler_toggled(bool checked); void on_useRationalDownsampler_toggled(bool checked);
void on_BW_valueChanged(int value); void on_BW_valueChanged(int value);
void on_lowCut_valueChanged(int value); void on_lowCut_valueChanged(int value);

View File

@ -197,6 +197,44 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QComboBox" name="pllPskOrder">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>PLL PSK order (1 for CW)</string>
</property>
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
<item>
<property name="text">
<string>16</string>
</property>
</item>
</widget>
</item>
<item> <item>
<widget class="ButtonSwitch" name="useRationalDownsampler"> <widget class="ButtonSwitch" name="useRationalDownsampler">
<property name="toolTip"> <property name="toolTip">