summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/complex_to_mag_squared_impl.cc
diff options
context:
space:
mode:
authorMarcus Müller <mmueller@gnuradio.org>2019-08-07 21:45:12 +0200
committerMarcus Müller <marcus@hostalia.de>2019-08-09 23:04:28 +0200
commitf7bbf2c1d8d780294f3e016aff239ca35eb6516e (patch)
treee09ab6112e02b2215b2d59ac24d3d6ea2edac745 /gr-blocks/lib/complex_to_mag_squared_impl.cc
parent78431dc6941e3acc67c858277dfe4a0ed583643c (diff)
Tree: clang-format without the include sorting
Diffstat (limited to 'gr-blocks/lib/complex_to_mag_squared_impl.cc')
-rw-r--r--gr-blocks/lib/complex_to_mag_squared_impl.cc66
1 files changed, 32 insertions, 34 deletions
diff --git a/gr-blocks/lib/complex_to_mag_squared_impl.cc b/gr-blocks/lib/complex_to_mag_squared_impl.cc
index 0e41ae0d4c..070d04e8cc 100644
--- a/gr-blocks/lib/complex_to_mag_squared_impl.cc
+++ b/gr-blocks/lib/complex_to_mag_squared_impl.cc
@@ -29,37 +29,35 @@
#include <volk/volk.h>
namespace gr {
- namespace blocks {
-
- complex_to_mag_squared::sptr complex_to_mag_squared::make(size_t vlen)
- {
- return gnuradio::get_initial_sptr(new complex_to_mag_squared_impl(vlen));
- }
-
- complex_to_mag_squared_impl::complex_to_mag_squared_impl(size_t vlen)
- : sync_block("complex_to_mag_squared",
- io_signature::make (1, 1, sizeof(gr_complex)*vlen),
- io_signature::make (1, 1, sizeof(float)*vlen)),
- d_vlen(vlen)
- {
- const int alignment_multiple =
- volk_get_alignment() / sizeof(float);
- set_alignment(std::max(1,alignment_multiple));
- }
-
- int
- complex_to_mag_squared_impl::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
- {
- const gr_complex *in = (const gr_complex *) input_items[0];
- float *out = (float *) output_items[0];
- int noi = noutput_items * d_vlen;
-
- volk_32fc_magnitude_squared_32f(out, in, noi);
-
- return noutput_items;
- }
-
- } /* namespace blocks */
-}/* namespace gr */
+namespace blocks {
+
+complex_to_mag_squared::sptr complex_to_mag_squared::make(size_t vlen)
+{
+ return gnuradio::get_initial_sptr(new complex_to_mag_squared_impl(vlen));
+}
+
+complex_to_mag_squared_impl::complex_to_mag_squared_impl(size_t vlen)
+ : sync_block("complex_to_mag_squared",
+ io_signature::make(1, 1, sizeof(gr_complex) * vlen),
+ io_signature::make(1, 1, sizeof(float) * vlen)),
+ d_vlen(vlen)
+{
+ const int alignment_multiple = volk_get_alignment() / sizeof(float);
+ set_alignment(std::max(1, alignment_multiple));
+}
+
+int complex_to_mag_squared_impl::work(int noutput_items,
+ gr_vector_const_void_star& input_items,
+ gr_vector_void_star& output_items)
+{
+ const gr_complex* in = (const gr_complex*)input_items[0];
+ float* out = (float*)output_items[0];
+ int noi = noutput_items * d_vlen;
+
+ volk_32fc_magnitude_squared_32f(out, in, noi);
+
+ return noutput_items;
+}
+
+} /* namespace blocks */
+} /* namespace gr */