From 3cdd3b114e82e341d7431fac72d58e6990fa8ec7 Mon Sep 17 00:00:00 2001 From: William Yang Date: Fri, 19 Jan 2024 20:12:13 +1100 Subject: [PATCH] Removed alignment check on fft/ifft since PRS symbol can be unaligned --- src/ofdm/ofdm_demodulator.cpp | 20 ++------------------ src/ofdm/profiler.h | 2 +- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/ofdm/ofdm_demodulator.cpp b/src/ofdm/ofdm_demodulator.cpp index 855789a..8cbd135 100644 --- a/src/ofdm/ofdm_demodulator.cpp +++ b/src/ofdm/ofdm_demodulator.cpp @@ -877,28 +877,12 @@ void OFDM_Demod::CalculateViterbiBits(tcb::span> vec_b void OFDM_Demod::CalculateFFT(tcb::span> fft_in, tcb::span> fft_out) { PROFILE_BEGIN_FUNC(); - // Guarantee alignment for FFTW3 SIMD - // For all DAB transmission modes we have a power of 2 FFT so this should ideally be true - assert((uintptr_t)fft_in.data() % ALIGN_AMOUNT == 0); - assert((uintptr_t)fft_out.data() % ALIGN_AMOUNT == 0); - - fftwf_execute_dft( - fft_plan, - (fftwf_complex*)fft_in.data(), - (fftwf_complex*)fft_out.data()); + fftwf_execute_dft(fft_plan, (fftwf_complex*)fft_in.data(), (fftwf_complex*)fft_out.data()); } void OFDM_Demod::CalculateIFFT(tcb::span> fft_in, tcb::span> fft_out) { PROFILE_BEGIN_FUNC(); - // Guarantee alignment for FFTW3 SIMD - // For all DAB transmission modes we have a power of 2 FFT so this should ideally be true - assert((uintptr_t)fft_in.data() % ALIGN_AMOUNT == 0); - assert((uintptr_t)fft_out.data() % ALIGN_AMOUNT == 0); - - fftwf_execute_dft( - ifft_plan, - (fftwf_complex*)fft_in.data(), - (fftwf_complex*)fft_out.data()); + fftwf_execute_dft(ifft_plan, (fftwf_complex*)fft_in.data(), (fftwf_complex*)fft_out.data()); } void OFDM_Demod::CalculateRelativePhase(tcb::span> fft_in, tcb::span> arg_out) { diff --git a/src/ofdm/profiler.h b/src/ofdm/profiler.h index 05325a0..493717e 100644 --- a/src/ofdm/profiler.h +++ b/src/ofdm/profiler.h @@ -235,7 +235,7 @@ class InstrumentationTimer #define PROFILE_ENABLE_TRACE_LOGGING(is_log) (void)0 #define PROFILE_ENABLE_TRACE_LOGGING_CONTINUOUS(is_continuous) (void)0 #else -#define PROFILE_BEGIN_FUNC() auto timer_##__PRETTY_FUNCTION__ = InstrumentationTimer(__PRETTY_FUNCTION__) +#define PROFILE_BEGIN_FUNC() auto timer_func = InstrumentationTimer(__PRETTY_FUNCTION__) #define PROFILE_BEGIN(label) auto timer_##label = InstrumentationTimer(#label) #define PROFILE_END(label) timer_##label.Stop() #define PROFILE_TAG_THREAD(label) Instrumentor::Get().GetInstrumentorThread().SetLabel(label)