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

Ensure bandwidth is positive. Use engineering units for bandwidths.

This commit is contained in:
Jon Beniston 2022-10-03 16:18:38 +01:00
parent 25709aa9a8
commit 97632e1b56
3 changed files with 5 additions and 4 deletions

View File

@ -2307,8 +2307,9 @@ void GLSpectrumView::measure3dBBandwidth()
}
// Calcualte bandwidth
float hzPerBin = m_sampleRate / (float) m_fftSize;
int bins = rightBin - leftBin - 1;
bins = std::max(1, bins);
float hzPerBin = m_sampleRate / (float) m_fftSize;
float bandwidth = bins * hzPerBin;
int centerBin = leftBin + (rightBin - leftBin) / 2;
float centerFrequency = binToFrequency(centerBin);

View File

@ -350,7 +350,7 @@ void SpectrumMeasurements::createAdjacentChannelPowerTable()
void SpectrumMeasurements::createOccupiedBandwidthTable()
{
QStringList rows = {"Occupied B/W"};
QStringList units = {" Hz"};
QStringList units = {"Hz"};
createMeasurementsTable(rows, units);
}
@ -358,7 +358,7 @@ void SpectrumMeasurements::createOccupiedBandwidthTable()
void SpectrumMeasurements::create3dBBandwidthTable()
{
QStringList rows = {"3dB B/W"};
QStringList units = {" Hz"};
QStringList units = {"Hz"};
createMeasurementsTable(rows, units);
}

View File

@ -157,7 +157,7 @@
</item>
<item>
<property name="text">
<string>Occupied b/w</string>
<string>Occupied bandwidth</string>
</property>
</item>
<item>