Integrate SNR reporting from latest RADE. (#797)
* Integrate SNR reporting from latest RADE. * Show -- for SNR when using RADE and not in sync. * Suppress SNR display when not in sync for legacy modes.pull/803/head
parent
37f6531039
commit
630764778c
|
@ -13,7 +13,7 @@ ExternalProject_Add(build_rade
|
||||||
SOURCE_DIR rade_src
|
SOURCE_DIR rade_src
|
||||||
BINARY_DIR rade_build
|
BINARY_DIR rade_build
|
||||||
GIT_REPOSITORY https://github.com/drowe67/radae.git
|
GIT_REPOSITORY https://github.com/drowe67/radae.git
|
||||||
GIT_TAG main
|
GIT_TAG dr-est_snr
|
||||||
CMAKE_ARGS ${RADE_CMAKE_ARGS}
|
CMAKE_ARGS ${RADE_CMAKE_ARGS}
|
||||||
#CMAKE_CACHE_ARGS -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
#CMAKE_CACHE_ARGS -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
|
|
|
@ -702,6 +702,19 @@ void FreeDVInterface::setReliableText(const char* callsign)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float FreeDVInterface::getSNREstimate()
|
||||||
|
{
|
||||||
|
if (txMode_ >= FREEDV_MODE_RADE)
|
||||||
|
{
|
||||||
|
// Special handling for RADE
|
||||||
|
return (getSync() ? rade_snrdB_3k_est(rade_) : 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return getCurrentRxModemStats()->snr_est;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IPipelineStep* FreeDVInterface::createTransmitPipeline(int inputSampleRate, int outputSampleRate, std::function<float()> getFreqOffsetFn)
|
IPipelineStep* FreeDVInterface::createTransmitPipeline(int inputSampleRate, int outputSampleRate, std::function<float()> getFreqOffsetFn)
|
||||||
{
|
{
|
||||||
std::vector<IPipelineStep*> parallelSteps;
|
std::vector<IPipelineStep*> parallelSteps;
|
||||||
|
|
|
@ -135,6 +135,8 @@ public:
|
||||||
|
|
||||||
void restartTxVocoder();
|
void restartTxVocoder();
|
||||||
|
|
||||||
|
float getSNREstimate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct ReceivePipelineState
|
struct ReceivePipelineState
|
||||||
{
|
{
|
||||||
|
|
18
src/main.cpp
18
src/main.cpp
|
@ -1682,8 +1682,9 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
|
||||||
|
|
||||||
float snr_limited;
|
float snr_limited;
|
||||||
// some APIs pass us invalid values, so lets trap it rather than bombing
|
// some APIs pass us invalid values, so lets trap it rather than bombing
|
||||||
if (!(isnan(freedvInterface.getCurrentRxModemStats()->snr_est) || isinf(freedvInterface.getCurrentRxModemStats()->snr_est))) {
|
float snrEstimate = freedvInterface.getSNREstimate();
|
||||||
g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*freedvInterface.getCurrentRxModemStats()->snr_est;
|
if (!(isnan(snrEstimate) || isinf(snrEstimate))) {
|
||||||
|
g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*snrEstimate;
|
||||||
}
|
}
|
||||||
snr_limited = g_snr;
|
snr_limited = g_snr;
|
||||||
if (snr_limited < -5.0) snr_limited = -5.0;
|
if (snr_limited < -5.0) snr_limited = -5.0;
|
||||||
|
@ -1691,10 +1692,17 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
|
||||||
char snr[15];
|
char snr[15];
|
||||||
snprintf(snr, 15, "%4.1f dB", g_snr);
|
snprintf(snr, 15, "%4.1f dB", g_snr);
|
||||||
|
|
||||||
|
if (freedvInterface.getSync())
|
||||||
|
{
|
||||||
wxString snr_string(snr);
|
wxString snr_string(snr);
|
||||||
m_textSNR->SetLabel(snr_string);
|
m_textSNR->SetLabel(snr_string);
|
||||||
m_gaugeSNR->SetValue((int)(snr_limited+5));
|
m_gaugeSNR->SetValue((int)(snr_limited+5));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_textSNR->SetLabel("--");
|
||||||
|
m_gaugeSNR->SetValue(0);
|
||||||
|
}
|
||||||
|
|
||||||
// Level Gauge -----------------------------------------------------------------------
|
// Level Gauge -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -1855,6 +1863,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
|
||||||
wxString wxCallsign = text;
|
wxString wxCallsign = text;
|
||||||
delete[] text;
|
delete[] text;
|
||||||
|
|
||||||
|
auto pendingSnr = (int)(g_snr + 0.5);
|
||||||
if (wxCallsign.Length() > 0)
|
if (wxCallsign.Length() > 0)
|
||||||
{
|
{
|
||||||
freedvInterface.resetReliableText();
|
freedvInterface.resetReliableText();
|
||||||
|
@ -1864,7 +1873,6 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
|
||||||
{
|
{
|
||||||
wxString rxCallsign = callsignFormat.GetMatch(wxCallsign, 1);
|
wxString rxCallsign = callsignFormat.GetMatch(wxCallsign, 1);
|
||||||
std::string pendingCallsign = rxCallsign.ToStdString();
|
std::string pendingCallsign = rxCallsign.ToStdString();
|
||||||
auto pendingSnr = (int)(g_snr + 0.5);
|
|
||||||
|
|
||||||
wxString freqString;
|
wxString freqString;
|
||||||
if (wxGetApp().appConfiguration.reportingConfiguration.reportingFrequencyAsKhz)
|
if (wxGetApp().appConfiguration.reportingConfiguration.reportingFrequencyAsKhz)
|
||||||
|
@ -1957,7 +1965,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
|
||||||
"",
|
"",
|
||||||
freedvInterface.getCurrentModeStr(),
|
freedvInterface.getCurrentModeStr(),
|
||||||
freq,
|
freq,
|
||||||
0
|
pendingSnr
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue