From f6d1e741a8648fc9d9fa37c3af7d511b7d5784ef Mon Sep 17 00:00:00 2001 From: schneider Date: Sun, 17 Nov 2024 20:56:29 +0100 Subject: [PATCH] fft_channelizer: use volk_32fc_s32fc_multiply2_32fc with VOLK >= 3.1 --- lib/fft_channelizer_impl.cc | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/fft_channelizer_impl.cc b/lib/fft_channelizer_impl.cc index 3c045a5..c356ec6 100644 --- a/lib/fft_channelizer_impl.cc +++ b/lib/fft_channelizer_impl.cc @@ -342,18 +342,35 @@ int fft_channelizer_impl::work(int noutput_items, // Construct the input to the reverse FFT. We need to copy the two halves // as the output of the initial FFT still is [DC, Positive Freq, Negative // Freq]. - volk_32fc_s32fc_multiply_32fc( + + gr_complex scale = 1. / d_fft_size; +#if VOLK_VERSION_MAJOR >= 3 && VOLK_VERSION_MINOR >=1 + volk_32fc_s32fc_multiply2_32fc( &d_ifft.get_inbuf()[0], &d_fft.get_outbuf()[positive_offset( d_fft_size, d_output_step, j, d_ifft_size)], - 1. / d_fft_size, + &scale, d_ifft_size / 2); - volk_32fc_s32fc_multiply_32fc( + volk_32fc_s32fc_multiply2_32fc( &d_ifft.get_inbuf()[d_ifft_size / 2], &d_fft.get_outbuf()[negative_offset( d_fft_size, d_output_step, j, d_ifft_size)], - 1. / d_fft_size, + &scale, + d_ifft_size / 2); +#else + volk_32fc_s32fc_multiply2_32fc( + &d_ifft.get_inbuf()[0], + &d_fft.get_outbuf()[positive_offset( + d_fft_size, d_output_step, j, d_ifft_size)], + scale, d_ifft_size / 2); + volk_32fc_s32fc_multiply2_32fc( + &d_ifft.get_inbuf()[d_ifft_size / 2], + &d_fft.get_outbuf()[negative_offset( + d_fft_size, d_output_step, j, d_ifft_size)], + scale, + d_ifft_size / 2); +#endif d_ifft.execute(); if (output_items.size() > 0) {