Skip to content

Commit

Permalink
Removed alignment check on fft/ifft since PRS symbol can be unaligned
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyang98 committed Jan 19, 2024
1 parent e5237d6 commit 3cdd3b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
20 changes: 2 additions & 18 deletions src/ofdm/ofdm_demodulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,28 +877,12 @@ void OFDM_Demod::CalculateViterbiBits(tcb::span<const std::complex<float>> vec_b

void OFDM_Demod::CalculateFFT(tcb::span<const std::complex<float>> fft_in, tcb::span<std::complex<float>> 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<const std::complex<float>> fft_in, tcb::span<std::complex<float>> 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<const std::complex<float>> fft_in, tcb::span<std::complex<float>> arg_out) {
Expand Down
2 changes: 1 addition & 1 deletion src/ofdm/profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3cdd3b1

Please sign in to comment.