mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 21:01:45 -05:00
FFT overlap: averaging tooltip correction
This commit is contained in:
parent
7d33899770
commit
b4e4450ce3
@ -233,6 +233,7 @@ void GLSpectrumGUI::on_fftOverlap_valueChanged(int value)
|
|||||||
ui->fftOverlapText->setText(tr("%1").arg(m_settings.m_fftOverlap));
|
ui->fftOverlapText->setText(tr("%1").arg(m_settings.m_fftOverlap));
|
||||||
setMaximumOverlap();
|
setMaximumOverlap();
|
||||||
applySettings();
|
applySettings();
|
||||||
|
setAveragingToolitp();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLSpectrumGUI::on_averagingMode_currentIndexChanged(int index)
|
void GLSpectrumGUI::on_averagingMode_currentIndexChanged(int index)
|
||||||
@ -497,10 +498,12 @@ void GLSpectrumGUI::setAveragingToolitp()
|
|||||||
if (m_glSpectrum)
|
if (m_glSpectrum)
|
||||||
{
|
{
|
||||||
QString s;
|
QString s;
|
||||||
|
float halfSize = m_settings.m_fftSize / 2;
|
||||||
|
float overlapFactor = (halfSize - m_settings.m_fftOverlap) / halfSize;
|
||||||
float averagingTime = (m_settings.m_fftSize * (getAveragingValue(m_settings.m_averagingIndex, m_settings.m_averagingMode) == 0 ?
|
float averagingTime = (m_settings.m_fftSize * (getAveragingValue(m_settings.m_averagingIndex, m_settings.m_averagingMode) == 0 ?
|
||||||
1 :
|
1 :
|
||||||
getAveragingValue(m_settings.m_averagingIndex, m_settings.m_averagingMode))) / (float) m_glSpectrum->getSampleRate();
|
getAveragingValue(m_settings.m_averagingIndex, m_settings.m_averagingMode))) / (float) m_glSpectrum->getSampleRate();
|
||||||
setNumberStr(averagingTime, 2, s);
|
setNumberStr(averagingTime*overlapFactor, 2, s);
|
||||||
ui->averaging->setToolTip(QString("Number of averaging samples (avg time: %1s)").arg(s));
|
ui->averaging->setToolTip(QString("Number of averaging samples (avg time: %1s)").arg(s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user