diff options
author | Marcus Müller <marcus.mueller@ettus.com> | 2018-01-28 14:14:54 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-02-03 15:04:56 +0100 |
commit | 5cef50cdb1f8b199ff1a466f509e4f3d7e90d69e (patch) | |
tree | 64bf79ff275b8ad688ab2cce161b51c5739f024a /gr-blocks/include/gnuradio/blocks/rotator.h | |
parent | a5589c6b85468cf3bf743033f6099665afbfe3a9 (diff) |
Use type-generic or float versions of cmath functions where appropriate.
Complements gnuradio/gnuradio#1563, larger-scope version of
the issue gnuradio/gnuradio#1561 .
Diffstat (limited to 'gr-blocks/include/gnuradio/blocks/rotator.h')
-rw-r--r-- | gr-blocks/include/gnuradio/blocks/rotator.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gr-blocks/include/gnuradio/blocks/rotator.h b/gr-blocks/include/gnuradio/blocks/rotator.h index 66843fde07..978297716d 100644 --- a/gr-blocks/include/gnuradio/blocks/rotator.h +++ b/gr-blocks/include/gnuradio/blocks/rotator.h @@ -26,6 +26,7 @@ #include <gnuradio/blocks/api.h> #include <gnuradio/gr_complex.h> #include <volk/volk.h> +#include <cmath> namespace gr { namespace blocks { @@ -41,8 +42,8 @@ namespace gr { rotator() : d_phase(1), d_phase_incr(1), d_counter(0) { } - void set_phase(gr_complex phase) { d_phase = phase / abs(phase); } - void set_phase_incr(gr_complex incr) { d_phase_incr = incr / abs(incr); } + void set_phase(gr_complex phase) { d_phase = phase / std::abs(phase); } + void set_phase_incr(gr_complex incr) { d_phase_incr = incr / std::abs(incr); } gr_complex rotate(gr_complex in) { @@ -52,7 +53,7 @@ namespace gr { d_phase *= d_phase_incr; // incr our phase (complex mult == add phases) if((d_counter % 512) == 0) - d_phase /= abs(d_phase); // Normalize to ensure multiplication is rotation + d_phase /= std::abs(d_phase); // Normalize to ensure multiplication is rotation return z; } |