Skip to content

Commit

Permalink
Merge pull request #1857 from das-Iro/fix-typecast
Browse files Browse the repository at this point in the history
Add explicit typecasting that was missing
  • Loading branch information
f4exb authored Oct 24, 2023
2 parents c9a4d54 + 7f9ed6d commit 1d3c366
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sdrgui/gui/glspectrumgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ void GLSpectrumGUI::setAveragingToolitp()
{
QString s;
int averagingIndex = m_settings.m_averagingMode == SpectrumSettings::AvgModeNone ? 0 : m_settings.m_averagingIndex;
float overlapFactor = (m_settings.m_fftSize - m_settings.m_fftOverlap) / m_settings.m_fftSize;
float overlapFactor = (m_settings.m_fftSize - m_settings.m_fftOverlap) / (float)m_settings.m_fftSize;
float averagingTime = (m_settings.m_fftSize * (SpectrumSettings::getAveragingValue(averagingIndex, m_settings.m_averagingMode) == 0 ?
1 :
SpectrumSettings::getAveragingValue(averagingIndex, m_settings.m_averagingMode))) / (float) m_glSpectrum->getSampleRate();
Expand Down
4 changes: 2 additions & 2 deletions sdrgui/gui/glspectrumview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2735,7 +2735,7 @@ void GLSpectrumView::applyChanges()
float timeScaleDiv = ((float)m_sampleRate / (float)m_timingRate);

if (m_fftSize > m_fftOverlap) {
timeScaleDiv *= m_fftSize / (m_fftSize - m_fftOverlap);
timeScaleDiv *= m_fftSize / (float)(m_fftSize - m_fftOverlap);
}

if (!m_invertedWaterfall) {
Expand Down Expand Up @@ -2828,7 +2828,7 @@ void GLSpectrumView::applyChanges()
float timeScaleDiv = ((float)m_sampleRate / (float)m_timingRate);

if (m_fftSize > m_fftOverlap) {
timeScaleDiv *= m_fftSize / (m_fftSize - m_fftOverlap);
timeScaleDiv *= m_fftSize / (float)(m_fftSize - m_fftOverlap);
}

if (!m_invertedWaterfall) {
Expand Down

0 comments on commit 1d3c366

Please sign in to comment.