From 4f0dac46471c5d7694264c8ea501963a40fe4b2b Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 20 Mar 2026 06:12:14 +0100 Subject: [PATCH] Meshtastic demod: removed unused FFT window --- .../channelrx/demodmeshtastic/meshtasticdemodsink.cpp | 9 +++------ plugins/channelrx/demodmeshtastic/meshtasticdemodsink.h | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp b/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp index 28d30200d..de1245850 100644 --- a/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp +++ b/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.cpp @@ -97,7 +97,7 @@ MeshtasticDemodSink::MeshtasticDemodSink() : m_chirp = 0; m_chirp0 = 0; - initSF(m_settings.m_spreadFactor, m_settings.m_deBits, m_settings.m_fftWindow); + initSF(m_settings.m_spreadFactor, m_settings.m_deBits); } MeshtasticDemodSink::~MeshtasticDemodSink() @@ -115,7 +115,7 @@ MeshtasticDemodSink::~MeshtasticDemodSink() delete[] m_spectrumLine; } -void MeshtasticDemodSink::initSF(unsigned int sf, unsigned int deBits, FFTWindow::Function fftWindow) +void MeshtasticDemodSink::initSF(unsigned int sf, unsigned int deBits) { if (m_downChirps) { delete[] m_downChirps; @@ -140,8 +140,6 @@ void MeshtasticDemodSink::initSF(unsigned int sf, unsigned int deBits, FFTWindow m_nbSymbolsEff = 1 << (sf - deBits); m_deLength = 1 << deBits; m_fftLength = m_nbSymbols; - m_fftWindow.create(fftWindow, m_fftLength); - m_fftWindow.setKaiserAlpha(M_PI); m_interpolatedFFTLength = m_fftInterpolation*m_fftLength; m_preambleTolerance = std::max(1, (m_deLength*static_cast(m_fftInterpolation))/2); m_fftSequence = fftFactory->getEngine(m_interpolatedFFTLength, false, &m_fft); @@ -1260,12 +1258,11 @@ void MeshtasticDemodSink::applySettings(const MeshtasticDemodSettings& settings, if ((settings.m_spreadFactor != m_settings.m_spreadFactor) || (settings.m_deBits != m_settings.m_deBits) - || (settings.m_fftWindow != m_settings.m_fftWindow) || fftInterpChanged || force) { m_fftInterpolation = desiredFFTInterpolation; - initSF(settings.m_spreadFactor, settings.m_deBits, settings.m_fftWindow); + initSF(settings.m_spreadFactor, settings.m_deBits); } const unsigned int configuredPreamble = settings.m_preambleChirps > 0U diff --git a/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.h b/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.h index a278162f6..47186e758 100644 --- a/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.h +++ b/plugins/channelrx/demodmeshtastic/meshtasticdemodsink.h @@ -102,7 +102,6 @@ private: FFTEngine *m_fft; int m_fftSequence; - FFTWindow m_fftWindow; Complex *m_downChirps; Complex *m_upChirps; Complex *m_spectrumLine; @@ -184,7 +183,7 @@ private: int m_deLength; //!< Number of FFT bins collated to represent one symbol int m_preambleTolerance; //!< Number of FFT bins to collate when looking for preamble - void initSF(unsigned int sf, unsigned int deBits, FFTWindow::Function fftWindow); //!< Init tables, FFTs, depending on spread factor + void initSF(unsigned int sf, unsigned int deBits); //!< Init tables, FFTs, depending on spread factor void reset(); unsigned int argmax( const Complex *fftBins,