[hamradio-commits] [gnss-sdr] 123/149: adding definition of new volk_gnsssdr kernel: 16-bit complex rotator
Carles Fernandez
carles_fernandez-guest at moszumanska.debian.org
Sat Feb 6 19:43:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
carles_fernandez-guest pushed a commit to branch next
in repository gnss-sdr.
commit 4e12f6ee5a06d738e23c0d7966d780ff3b3e2f10
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date: Wed Jan 27 18:34:20 2016 +0100
adding definition of new volk_gnsssdr kernel: 16-bit complex rotator
generic implementation only
---
.../volk_gnsssdr_16ic_rotatorpuppet_16ic.h | 32 +++++++
.../volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h | 104 +++++++++++++++++++++
.../volk_gnsssdr/lib/kernel_tests.h | 1 +
3 files changed, 137 insertions(+)
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h
new file mode 100644
index 0000000..f13b5ee
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_rotatorpuppet_16ic.h
@@ -0,0 +1,32 @@
+#ifndef INCLUDED_volk_gnsssdr_16ic_rotatorpuppet_16ic_H
+#define INCLUDED_volk_gnsssdr_16ic_rotatorpuppet_16ic_H
+
+
+#include <volk_gnsssdr/volk_gnsssdr_complex.h>
+#include "volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h"
+
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_generic(lv_16sc_t* outVector, const lv_16sc_t* inVector, unsigned int num_points)
+{
+ lv_32fc_t phase[1] = {lv_cmake(.3, 0.95393)};
+ const lv_32fc_t phase_inc = lv_cmake(.1, 0.01);
+ volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(outVector, inVector, phase_inc, phase, num_points);
+}
+
+#endif /* LV_HAVE_GENERIC */
+
+#ifdef LV_HAVE_NEON
+
+static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon(lv_16sc_t* outVector, const lv_16sc_t* inVector, unsigned int num_points)
+{
+ lv_32fc_t phase[1] = {lv_cmake(.3, 0.95393)};
+ const lv_32fc_t phase_inc = lv_cmake(.1, 0.01);
+ volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(outVector, inVector, phase_inc, phase, num_points);
+}
+
+#endif /* LV_HAVE_NEON */
+
+
+#endif /* INCLUDED_volk_gnsssdr_16ic_rotatorpuppet_16ic_H */
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h
new file mode 100644
index 0000000..e94f0ef
--- /dev/null
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_16ic_s32fc_x2_rotator_16ic.h
@@ -0,0 +1,104 @@
+/*!
+ * \file volk_16ic_s32fc_x2_rotator_16ic.h
+ * \brief Volk protokernel: rotates a 16 bits complex vector
+ * \authors <ul>
+ * <li> Carles Fernandez-Prades, 2015 cfernandez at cttc.es
+ * </ul>
+ *
+ * Volk protokernel that rotates a 16-bit complex vector
+ *
+ * -------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
+ *
+ * GNSS-SDR is a software defined Global Navigation
+ * Satellite Systems receiver
+ *
+ * This file is part of GNSS-SDR.
+ *
+ * GNSS-SDR is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GNSS-SDR is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+
+#ifndef INCLUDED_volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_H
+#define INCLUDED_volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_H
+
+#include <volk_gnsssdr/volk_gnsssdr_complex.h>
+#include <math.h>
+#define ROTATOR_RELOAD 512
+
+
+#ifdef LV_HAVE_GENERIC
+
+static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points)
+{
+ unsigned int i = 0;
+ int j = 0;
+ for(i = 0; i < (unsigned int)(num_points / ROTATOR_RELOAD); ++i)
+ {
+ for(j = 0; j < ROTATOR_RELOAD; ++j)
+ {
+ *outVector++ = *inVector++ * (*phase);
+ (*phase) *= phase_inc;
+ }
+#ifdef __cplusplus
+ (*phase) /= std::abs((*phase));
+#else
+ //(*phase) /= cabsf((*phase));
+ (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
+#endif
+ }
+ for(i = 0; i < num_points % ROTATOR_RELOAD; ++i)
+ {
+ *outVector++ = *inVector++ * (*phase);
+ (*phase) *= phase_inc;
+ }
+}
+
+#endif /* LV_HAVE_GENERIC */
+
+#ifdef LV_HAVE_NEON
+#include <arm.neon.h>
+static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points)
+{
+ unsigned int i = 0;
+ int j = 0;
+ for(i = 0; i < (unsigned int)(num_points / ROTATOR_RELOAD); ++i)
+ {
+ for(j = 0; j < ROTATOR_RELOAD; ++j)
+ {
+ *outVector++ = *inVector++ * (*phase);
+ (*phase) *= phase_inc;
+ }
+#ifdef __cplusplus
+ (*phase) /= std::abs((*phase));
+#else
+ //(*phase) /= cabsf((*phase));
+ (*phase) /= hypotf(lv_creal(*phase), lv_cimag(*phase));
+#endif
+ }
+ for(i = 0; i < num_points % ROTATOR_RELOAD; ++i)
+ {
+ *outVector++ = *inVector++ * (*phase);
+ (*phase) *= phase_inc;
+ }
+}
+
+#endif /* LV_HAVE_NEON */
+
+
+#endif
+
diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h
index 1f80629..0235218 100644
--- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h
+++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/kernel_tests.h
@@ -77,6 +77,7 @@ std::vector<volk_gnsssdr_test_case_t> init_test_list(volk_gnsssdr_test_params_t
(VOLK_INIT_TEST(volk_gnsssdr_16ic_x2_dot_prod_16ic, test_params))
(VOLK_INIT_TEST(volk_gnsssdr_16ic_x2_multiply_16ic, test_params_more_iters))
(VOLK_INIT_TEST(volk_gnsssdr_16ic_convert_32fc, test_params_more_iters))
+ (VOLK_INIT_PUPP(volk_gnsssdr_16ic_rotatorpuppet_16ic, volk_gnsssdr_16ic_s32fc_x2_rotator_16ic, test_params))
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerpuppet_16ic, volk_gnsssdr_16ic_resampler_16ic, test_params))
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_resamplerxnpuppet_16ic, volk_gnsssdr_16ic_xn_resampler_16ic_xn, test_params))
(VOLK_INIT_PUPP(volk_gnsssdr_16ic_x2_dotprodxnpuppet_16ic, volk_gnsssdr_16ic_x2_dot_prod_16ic_xn, test_params))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git
More information about the pkg-hamradio-commits
mailing list