diff options
Diffstat (limited to 'gnuradio-runtime/lib/math')
-rw-r--r-- | gnuradio-runtime/lib/math/fast_atan2f.cc | 2 | ||||
-rw-r--r-- | gnuradio-runtime/lib/math/qa_fxpt.cc | 2 | ||||
-rw-r--r-- | gnuradio-runtime/lib/math/qa_fxpt_nco.cc | 6 | ||||
-rw-r--r-- | gnuradio-runtime/lib/math/qa_fxpt_vco.cc | 18 |
4 files changed, 18 insertions, 10 deletions
diff --git a/gnuradio-runtime/lib/math/fast_atan2f.cc b/gnuradio-runtime/lib/math/fast_atan2f.cc index f968310ff8..72e7291913 100644 --- a/gnuradio-runtime/lib/math/fast_atan2f.cc +++ b/gnuradio-runtime/lib/math/fast_atan2f.cc @@ -114,7 +114,7 @@ namespace gr { Description: This function calculates the angle of the vector (x,y) based on a table lookup and linear interpolation. The table uses a - 256 point table covering -45 to +45 degrees and uses symetry to + 256 point table covering -45 to +45 degrees and uses symmetry to determine the final angle value in the range of -180 to 180 degrees. Note that this function uses the small angle approximation for values close to zero. This routine calculates the arc tangent diff --git a/gnuradio-runtime/lib/math/qa_fxpt.cc b/gnuradio-runtime/lib/math/qa_fxpt.cc index 070fb66ccf..d3aadf85b1 100644 --- a/gnuradio-runtime/lib/math/qa_fxpt.cc +++ b/gnuradio-runtime/lib/math/qa_fxpt.cc @@ -46,7 +46,7 @@ qa_fxpt::t0() * These are disabled because of some precision issues. * * Different compilers seem to have different opinions on whether - * the calulations are done single or double (or extended) + * the calculations are done single or double (or extended) * precision. Any of the answers are fine for our real purpose, but * sometimes the answer is off by a few bits at the bottom. * Hence, the disabled check. diff --git a/gnuradio-runtime/lib/math/qa_fxpt_nco.cc b/gnuradio-runtime/lib/math/qa_fxpt_nco.cc index cf229d68be..16ea120381 100644 --- a/gnuradio-runtime/lib/math/qa_fxpt_nco.cc +++ b/gnuradio-runtime/lib/math/qa_fxpt_nco.cc @@ -86,8 +86,8 @@ qa_fxpt_nco::t1() { gr::nco<float,float> ref_nco; gr::fxpt_nco new_nco; - gr_complex ref_block[SIN_COS_BLOCK_SIZE]; - gr_complex new_block[SIN_COS_BLOCK_SIZE]; + gr_complex* ref_block = new gr_complex[SIN_COS_BLOCK_SIZE]; + gr_complex* new_block = new gr_complex[SIN_COS_BLOCK_SIZE]; double max_error = 0; ref_nco.set_freq((float)(2 * M_PI / SIN_COS_FREQ)); @@ -107,6 +107,8 @@ qa_fxpt_nco::t1() } CPPUNIT_ASSERT_DOUBLES_EQUAL (ref_nco.get_phase(), new_nco.get_phase(), SIN_COS_TOLERANCE); // printf ("Fxpt max error %.9f, max phase error %.9f\n", max_error, max_phase_error); + delete[] ref_block; + delete[] new_block; } void diff --git a/gnuradio-runtime/lib/math/qa_fxpt_vco.cc b/gnuradio-runtime/lib/math/qa_fxpt_vco.cc index 8ee402fdc1..a406c12c0f 100644 --- a/gnuradio-runtime/lib/math/qa_fxpt_vco.cc +++ b/gnuradio-runtime/lib/math/qa_fxpt_vco.cc @@ -79,9 +79,9 @@ qa_fxpt_vco::t1() { gr::vco<float,float> ref_vco; gr::fxpt_vco new_vco; - float ref_block[SIN_COS_BLOCK_SIZE]; - float new_block[SIN_COS_BLOCK_SIZE]; - float input[SIN_COS_BLOCK_SIZE]; + float *ref_block = new float[SIN_COS_BLOCK_SIZE]; + float *new_block = new float[SIN_COS_BLOCK_SIZE]; + float *input = new float[SIN_COS_BLOCK_SIZE]; double max_error = 0; for(int i = 0; i < SIN_COS_BLOCK_SIZE; i++) { @@ -97,6 +97,9 @@ qa_fxpt_vco::t1() } CPPUNIT_ASSERT_DOUBLES_EQUAL(ref_vco.get_phase(), new_vco.get_phase(), SIN_COS_TOLERANCE); // printf ("Fxpt max error %.9f, max phase error %.9f\n", max_error, ref_vco.get_phase()-new_vco.get_phase()); + delete[] ref_block; + delete[] new_block; + delete[] input; } void @@ -104,9 +107,9 @@ qa_fxpt_vco::t2() { gr::vco<gr_complex,float> ref_vco; gr::fxpt_vco new_vco; - gr_complex ref_block[SIN_COS_BLOCK_SIZE]; - gr_complex new_block[SIN_COS_BLOCK_SIZE]; - float input[SIN_COS_BLOCK_SIZE]; + gr_complex *ref_block = new gr_complex[SIN_COS_BLOCK_SIZE]; + gr_complex *new_block = new gr_complex[SIN_COS_BLOCK_SIZE]; + float *input = new float[SIN_COS_BLOCK_SIZE]; double max_error = 0; for(int i = 0; i < SIN_COS_BLOCK_SIZE; i++) { @@ -122,6 +125,9 @@ qa_fxpt_vco::t2() } CPPUNIT_ASSERT_DOUBLES_EQUAL(ref_vco.get_phase(), new_vco.get_phase(), SIN_COS_TOLERANCE); // printf ("Fxpt max error %.9f, max phase error %.9f\n", max_error, ref_vco.get_phase()-new_vco.get_phase()); + delete[] ref_block; + delete[] new_block; + delete[] input; } void |