diff options
Diffstat (limited to 'gnuradio-core/src')
9 files changed, 17 insertions, 12 deletions
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc index e87d93ebf..ca76c8eb8 100644 --- a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc +++ b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc @@ -42,6 +42,7 @@ typedef gr_complex acc_type; using std::vector; +#define MAX_DATA (32767) #define ERR_DELTA (1e-5) #define NELEM(x) (sizeof (x) / sizeof (x[0])) @@ -56,8 +57,8 @@ static void random_complex (gr_complex *buf, unsigned n) { for (unsigned i = 0; i < n; i++){ - float re = rint (uniform () * 32767); - float im = rint (uniform () * 32767); + float re = rint (uniform () * MAX_DATA); + float im = rint (uniform () * MAX_DATA); buf[i] = gr_complex (re, im); } } @@ -151,7 +152,7 @@ qa_gri_fir_filter_with_buffer_ccc::test_decimate(unsigned int decimate) for (int o = 0; o < (int)(ol/decimate); o++){ CPPUNIT_ASSERT_COMPLEXES_EQUAL(expected_output[o], actual_output[o], - abs (expected_output[o]) * ERR_DELTA); + sqrt((float)n)*0.25*MAX_DATA*MAX_DATA * ERR_DELTA); } delete f1; } diff --git a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc index c76ede542..154611c32 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc +++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc @@ -26,7 +26,6 @@ #include <gr_tagged_file_sink.h> #include <gr_io_signature.h> -#include <cstdio> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> diff --git a/gnuradio-core/src/lib/io/gr_tagged_file_sink.h b/gnuradio-core/src/lib/io/gr_tagged_file_sink.h index 956340f8d..2e0a5c63a 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.h +++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.h @@ -24,6 +24,7 @@ #define INCLUDED_GR_TAGGED_FILE_SINK_H #include <gr_sync_block.h> +#include <cstdio> // for FILE class gr_tagged_file_sink; typedef boost::shared_ptr<gr_tagged_file_sink> gr_tagged_file_sink_sptr; diff --git a/gnuradio-core/src/lib/io/gr_wavfile_source.cc b/gnuradio-core/src/lib/io/gr_wavfile_source.cc index d00dd3028..136e52611 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_source.cc +++ b/gnuradio-core/src/lib/io/gr_wavfile_source.cc @@ -27,7 +27,6 @@ #include <gr_wavfile_source.h> #include <gr_io_signature.h> #include <gri_wavfile.h> -#include <cstdio> #include <sys/types.h> #include <fcntl.h> #include <stdexcept> diff --git a/gnuradio-core/src/lib/io/gr_wavfile_source.h b/gnuradio-core/src/lib/io/gr_wavfile_source.h index 0c663f0a0..e434a6b4c 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_source.h +++ b/gnuradio-core/src/lib/io/gr_wavfile_source.h @@ -24,6 +24,7 @@ #define INCLUDED_GR_WAVFILE_SOURCE_H #include <gr_sync_block.h> +#include <cstdio> // for FILE class gr_wavfile_source; typedef boost::shared_ptr<gr_wavfile_source> gr_wavfile_source_sptr; diff --git a/gnuradio-core/src/lib/runtime/gr_error_handler.cc b/gnuradio-core/src/lib/runtime/gr_error_handler.cc index 6dbb0a5d2..4b4cdacef 100644 --- a/gnuradio-core/src/lib/runtime/gr_error_handler.cc +++ b/gnuradio-core/src/lib/runtime/gr_error_handler.cc @@ -48,7 +48,6 @@ #include <assert.h> #include <stdexcept> #include <unistd.h> -#include <stdio.h> #ifdef HAVE_IO_H #include <io.h> diff --git a/gnuradio-core/src/lib/runtime/gr_error_handler.h b/gnuradio-core/src/lib/runtime/gr_error_handler.h index 530a2c23c..aedb6f41f 100644 --- a/gnuradio-core/src/lib/runtime/gr_error_handler.h +++ b/gnuradio-core/src/lib/runtime/gr_error_handler.h @@ -45,6 +45,7 @@ #include <stdarg.h> #include <string> +#include <cstdio> // for FILE /*! * \brief abstract error handler diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc index 5d53a9f89..8ef26a40d 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc @@ -56,7 +56,8 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) { int i; gr_complex coeffs[NTAPS]; - gr_complex input[BLOCK_SIZE + NTAPS]; + //gr_complex input[BLOCK_SIZE + NTAPS]; // not always 16-bit aligned + gr_complex *input = new gr_complex[BLOCK_SIZE + NTAPS]; long n; gr_complex result; #ifdef HAVE_SYS_RESOURCE_H @@ -86,7 +87,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) exit (1); } #else - clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC); + clock_start= (double) clock() / CLOCKS_PER_SEC; #endif // do the actual work @@ -116,7 +117,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) double total = user + sys; #else - clock_end = (double) clock() * (1000000. / CLOCKS_PER_SEC); + clock_end = (double) clock() / CLOCKS_PER_SEC; double total = clock_end - clock_start; #endif @@ -126,6 +127,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); delete f; + delete [] input; } static void diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc index 60855ec94..ed3c49165 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc @@ -56,7 +56,8 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) { int i; float coeffs[NTAPS]; - gr_complex input[BLOCK_SIZE + NTAPS]; + //gr_complex input[BLOCK_SIZE + NTAPS]; // not always 16-bit aligned + gr_complex *input = new gr_complex[BLOCK_SIZE + NTAPS]; long n; gr_complex result; #ifdef HAVE_SYS_RESOURCE_H @@ -86,7 +87,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) exit (1); } #else - clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC); + clock_start= (double) clock() / CLOCKS_PER_SEC; #endif // do the actual work @@ -118,7 +119,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) double total = user + sys; #else - clock_end= (double) clock() * (1000000. / CLOCKS_PER_SEC); + clock_end= (double) clock() / CLOCKS_PER_SEC; double total = clock_end - clock_start; #endif @@ -128,6 +129,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); delete f; + delete [] input; } static void |