1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

ADS-B: added 2MS/s sample rate and moving average for instant correlation values

This commit is contained in:
f4exb 2020-10-31 05:09:28 +01:00
parent 9160742ebe
commit ecbf85e1a0
5 changed files with 19 additions and 7 deletions

View File

@ -350,10 +350,12 @@ void ADSBDemodGUI::handleADSB(const QByteArray data, const QDateTime dateTime, f
aircraft->m_adsbFrameCount++;
aircraft->m_adsbFrameCountItem->setText(QString("%1").arg(aircraft->m_adsbFrameCount));
aircraft->m_minCorrelation = correlationZeros;
m_correlationZerosAvg(correlationZeros);
aircraft->m_minCorrelation = m_correlationZerosAvg.instantAverage();
if (correlationOnes > aircraft->m_maxCorrelation)
aircraft->m_maxCorrelation = correlationOnes;
aircraft->m_correlation = correlationOnes;
m_correlationOnesAvg(correlationOnes);
aircraft->m_correlation = m_correlationOnesAvg.instantAverage();
aircraft->m_correlationItem->setText(QString("%1/%2/%3")
.arg(CalcDb::dbPower(aircraft->m_minCorrelation), 3, 'f', 1)
.arg(CalcDb::dbPower(aircraft->m_correlation), 3, 'f', 1)
@ -756,7 +758,7 @@ void ADSBDemodGUI::on_adsbData_cellDoubleClicked(int row, int column)
void ADSBDemodGUI::on_spb_currentIndexChanged(int value)
{
m_settings.m_samplesPerBit = (value + 2) * 2;
m_settings.m_samplesPerBit = (value + 1) * 2;
applySettings();
}
@ -937,7 +939,7 @@ void ADSBDemodGUI::displaySettings()
ui->rfBWText->setText(QString("%1M").arg(m_settings.m_rfBandwidth / 1000000.0, 0, 'f', 1));
ui->rfBW->setValue((int)m_settings.m_rfBandwidth);
ui->spb->setCurrentIndex(m_settings.m_samplesPerBit/2-2);
ui->spb->setCurrentIndex(m_settings.m_samplesPerBit/2-1);
ui->thresholdText->setText(QString("%1").arg(m_settings.m_correlationThreshold, 0, 'f', 1));
ui->threshold->setValue((int)(m_settings.m_correlationThreshold*10));

View File

@ -30,6 +30,7 @@
#include "dsp/movingaverage.h"
#include "util/messagequeue.h"
#include "util/azel.h"
#include "util/movingaverage.h"
#include "adsbdemodsettings.h"
@ -237,6 +238,8 @@ private:
AzEl m_azEl; // Position of station
Aircraft *m_trackAircraft; // Aircraft we want to track in Channel Report
MovingAverageUtil<float, double, 10> m_correlationOnesAvg;
MovingAverageUtil<float, double, 10> m_correlationZerosAvg;
explicit ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
virtual ~ADSBDemodGUI();

View File

@ -280,6 +280,11 @@
<property name="toolTip">
<string>Demodulator sample rate. This should ideally be matched to baseband sample rate</string>
</property>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>

View File

@ -35,7 +35,7 @@ void ADSBDemodSettings::resetToDefaults()
m_inputFrequencyOffset = 0;
m_rfBandwidth = 2*1300000;
m_correlationThreshold = -50.0f;
m_samplesPerBit = 6;
m_samplesPerBit = 4;
m_removeTimeout = 60;
m_beastEnabled = false;
m_beastHost = "feed.adsbexchange.com";
@ -103,7 +103,7 @@ bool ADSBDemodSettings::deserialize(const QByteArray& data)
m_inputFrequencyOffset = tmp;
d.readReal(2, &m_rfBandwidth, 2*1300000);
d.readReal(3, &m_correlationThreshold, -50.0f);
d.readS32(4, &m_samplesPerBit, 6);
d.readS32(4, &m_samplesPerBit, 4);
d.readS32(5, &m_removeTimeout, 60);
d.readBool(6, &m_beastEnabled, false);
d.readString(7, &m_beastHost, "feed.adsbexchange.com");

View File

@ -28,7 +28,9 @@ This is the bandwidth in MHz of the channel signal before demodulation.
<h3>5: SR - Channel Sample Rate</h3>
This specifies the channel sample rate the demodulator uses. Values of 4M-12MSa/s are supported, 2MSa/s steps. Ideally, this should be set to the same value as the baseband sample rate (the sample rate received from the radio). If it is different from the baseband sample rate, interpolation or decimation will be performed as needed to match the rates. However, interpolation currently requires a significant amount of processing power and may result in dropped samples.
This specifies the channel sample rate the demodulator uses. Values of 2M-12MSa/s are supported, 2MSa/s steps. Ideally, this should be set to the same value as the baseband sample rate (the sample rate received from the radio). If it is different from the baseband sample rate, interpolation or decimation will be performed as needed to match the rates. However, interpolation currently requires a significant amount of processing power and may result in dropped samples.
2 MSa/s should give decent decodes. Higher rates may be experienced with if your hardware allows it (radio device and processing power). However the higher the rate the more processing power required.
Higher channel sample rates may help decode more frames, but will require more processing power.