40 #ifndef INCLUDED_volk_32fc_s32f_power_spectrum_32f_a_H
41 #define INCLUDED_volk_32fc_s32f_power_spectrum_32f_a_H
47 #ifdef LV_HAVE_GENERIC
52 const float normalizationFactor,
53 unsigned int num_points)
56 const float normFactSq = 1.0 / (normalizationFactor * normalizationFactor);
80 volk_32fc_magnitude_squared_32f(logPowerOutput, complexFFTInput, num_points);
83 volk_32f_s32f_multiply_32f(logPowerOutput, logPowerOutput, normFactSq, num_points);
87 volk_32f_log2_32f(logPowerOutput, logPowerOutput, num_points);
88 volk_32f_s32f_multiply_32f(
94 #include <pmmintrin.h>
96 #ifdef LV_HAVE_LIB_SIMDMATH
103 const float normalizationFactor,
104 unsigned int num_points)
106 const float* inputPtr = (
const float*)complexFFTInput;
107 float* destPtr = logPowerOutput;
109 const float iNormalizationFactor = 1.0 / normalizationFactor;
110 #ifdef LV_HAVE_LIB_SIMDMATH
112 magScalar =
_mm_div_ps(magScalar, logf4(magScalar));
118 const uint64_t quarterPoints = num_points / 4;
119 for (; number < quarterPoints; number++) {
127 input1 =
_mm_mul_ps(input1, invNormalizationFactor);
128 input2 =
_mm_mul_ps(input2, invNormalizationFactor);
141 power = logf4(power);
152 number = quarterPoints * 4;
156 for (; number < num_points; number++) {
163 const float real = *inputPtr++ * iNormalizationFactor;
164 const float imag = *inputPtr++ * iNormalizationFactor;
174 #include <arm_neon.h>
180 const float normalizationFactor,
181 unsigned int num_points)
183 float* logPowerOutputPtr = logPowerOutput;
184 const lv_32fc_t* complexFFTInputPtr = complexFFTInput;
185 const float iNormalizationFactor = 1.0 / normalizationFactor;
187 unsigned int quarter_points = num_points / 4;
188 float32x4x2_t fft_vec;
189 float32x4_t log_pwr_vec;
190 float32x4_t mag_squared_vec;
192 const float inv_ln10_10 = 4.34294481903f;
194 for (number = 0; number < quarter_points; number++) {
196 fft_vec = vld2q_f32((
float*)complexFFTInputPtr);
200 fft_vec.val[0] = vmulq_n_f32(fft_vec.val[0], iNormalizationFactor);
201 fft_vec.val[1] = vmulq_n_f32(fft_vec.val[1], iNormalizationFactor);
203 log_pwr_vec = vmulq_n_f32(
_vlogq_f32(mag_squared_vec), inv_ln10_10);
205 vst1q_f32(logPowerOutputPtr, log_pwr_vec);
207 complexFFTInputPtr += 4;
208 logPowerOutputPtr += 4;
212 for (number = quarter_points * 4; number < num_points; number++) {
213 const float real =
lv_creal(*complexFFTInputPtr) * iNormalizationFactor;
214 const float imag =
lv_cimag(*complexFFTInputPtr) * iNormalizationFactor;
218 complexFFTInputPtr++;
float32x4_t __m128
Definition: sse2neon.h:235
FORCE_INLINE __m128 _mm_hadd_ps(__m128 a, __m128 b)
Definition: sse2neon.h:6527
FORCE_INLINE __m128 _mm_div_ps(__m128 a, __m128 b)
Definition: sse2neon.h:1756
FORCE_INLINE __m128 _mm_mul_ps(__m128 a, __m128 b)
Definition: sse2neon.h:2205
FORCE_INLINE __m128 _mm_set_ps1(float)
Definition: sse2neon.h:2437
FORCE_INLINE __m128 _mm_load_ps(const float *p)
Definition: sse2neon.h:1858
FORCE_INLINE void _mm_store_ps(float *p, __m128 a)
Definition: sse2neon.h:2704
static void volk_32fc_s32f_power_spectrum_32f_a_sse3(float *logPowerOutput, const lv_32fc_t *complexFFTInput, const float normalizationFactor, unsigned int num_points)
Definition: volk_32fc_s32f_power_spectrum_32f.h:101
static void volk_32fc_s32f_power_spectrum_32f_generic(float *logPowerOutput, const lv_32fc_t *complexFFTInput, const float normalizationFactor, unsigned int num_points)
Definition: volk_32fc_s32f_power_spectrum_32f.h:50
static void volk_32fc_s32f_power_spectrum_32f_neon(float *logPowerOutput, const lv_32fc_t *complexFFTInput, const float normalizationFactor, unsigned int num_points)
Definition: volk_32fc_s32f_power_spectrum_32f.h:178
#define volk_log2to10factor
Definition: volk_common.h:169
static float log2f_non_ieee(float f)
Definition: volk_common.h:159
#define __VOLK_PREFETCH(addr)
Definition: volk_common.h:71
#define lv_cimag(x)
Definition: volk_complex.h:98
#define lv_creal(x)
Definition: volk_complex.h:96
float complex lv_32fc_t
Definition: volk_complex.h:74
static float32x4_t _vlogq_f32(float32x4_t x)
Definition: volk_neon_intrinsics.h:143
static float32x4_t _vmagnitudesquaredq_f32(float32x4x2_t cmplxValue)
Definition: volk_neon_intrinsics.h:73