diff options
-rw-r--r-- | gr-fec/lib/ber_tools.cc | 11 | ||||
-rw-r--r-- | gr-qtgui/lib/ber_sink_b_impl.cc | 4 | ||||
-rw-r--r-- | volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h | 4 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gr-fec/lib/ber_tools.cc b/gr-fec/lib/ber_tools.cc index 675932a690..043fbef216 100644 --- a/gr-fec/lib/ber_tools.cc +++ b/gr-fec/lib/ber_tools.cc @@ -20,6 +20,12 @@ * Boston, MA 02110-1301, USA. */ +#include <cstdlib> +#ifdef _MSC_VER +#define _USE_MATH_DEFINES +#include <cmath> +#endif + #include "ber_tools.h" inline int @@ -35,8 +41,13 @@ gaussnoise(float *inbuffer, int buffsize, float sigma) float udrn1=0.0, udrn2=0.0, noise=0.0; for(i = 0; i < buffsize;i++) { + #ifdef _MSC_VER + while((udrn1 = (float)(std::rand())) < 0.0000001); + udrn2 = (float)(std::rand()); + #else while((udrn1 = (float)drand48()) < 0.0000001); udrn2 = (float)drand48(); + #endif noise = sigma*sqrt(-2*log(udrn1))*cos(2*M_PI*udrn2); inbuffer[i] += noise; } diff --git a/gr-qtgui/lib/ber_sink_b_impl.cc b/gr-qtgui/lib/ber_sink_b_impl.cc index bcbe146e80..61dec2573a 100644 --- a/gr-qtgui/lib/ber_sink_b_impl.cc +++ b/gr-qtgui/lib/ber_sink_b_impl.cc @@ -21,11 +21,11 @@ */ #include "ber_sink_b_impl.h" +#include <boost/math/special_functions/erf.hpp> #include <gnuradio/io_signature.h> #include <gnuradio/math.h> #include <gnuradio/fft/fft.h> #include <volk/volk.h> -//#include <math.h> #ifdef HAVE_CONFIG_H #include <config.h> @@ -90,7 +90,7 @@ namespace gr { for(size_t i = 0; i < esnos.size(); i++) { double e = pow(10.0, esnos[i]/10.0); d_esno_buffers[curves][i] = esnos[i]; - d_ber_buffers[curves][i] = log10(erfc(sqrt(e))); + d_ber_buffers[curves][i] = log10(boost::math::erfc(sqrt(e))); } diff --git a/volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h b/volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h index 7b29438b84..ece8cf0f48 100644 --- a/volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h +++ b/volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h @@ -8,7 +8,11 @@ typedef union { unsigned int w[64/*NUMSTATES*//32]; unsigned short s[64/*NUMSTATES*//16]; unsigned char c[64/*NUMSTATES*//8]; +#ifdef _MSC_VER +} decision_t; +#else } decision_t __attribute__ ((aligned (16))); +#endif static inline void renormalize(unsigned char* X, unsigned char threshold){ int NUMSTATES = 64; |