From 49476017b7cf69ddd6739d5cd0d50d867e2c8436 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 6 Feb 2012 15:32:43 -0500 Subject: core: fix a warning. --- gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src') diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc index 948ab20b9..8a6b2fe8a 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc @@ -68,7 +68,7 @@ gr_fft_vcc_fftw::work (int noutput_items, if (d_window.size()){ gr_complex *dst = d_fft->get_inbuf(); if(!d_forward && d_shift){ - int offset = (!d_forward && d_shift)?(d_fft_size/2):0; + unsigned int offset = (!d_forward && d_shift)?(d_fft_size/2):0; int fft_m_offset = d_fft_size - offset; for (unsigned int i = 0; i < offset; i++) // apply window dst[i+fft_m_offset] = in[i] * d_window[i]; -- cgit From bea38e035f1c0b6847acb239900d7652a786b78b Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 6 Feb 2012 16:14:37 -0500 Subject: docs: fixed some markup of formulas between html and xml (and therefore the swigdocs). --- gnuradio-core/src/lib/filter/gr_iir_filter_ffd.h | 16 +++++++++++----- .../src/lib/filter/gr_single_pole_iir_filter_cc.h | 16 +++++++++++----- .../src/lib/filter/gr_single_pole_iir_filter_ff.h | 16 +++++++++++----- 3 files changed, 33 insertions(+), 15 deletions(-) (limited to 'gnuradio-core/src') diff --git a/gnuradio-core/src/lib/filter/gr_iir_filter_ffd.h b/gnuradio-core/src/lib/filter/gr_iir_filter_ffd.h index 386d056e5..ba0c78486 100644 --- a/gnuradio-core/src/lib/filter/gr_iir_filter_ffd.h +++ b/gnuradio-core/src/lib/filter/gr_iir_filter_ffd.h @@ -43,16 +43,22 @@ gr_make_iir_filter_ffd (const std::vector &fftaps, * * * The input and output satisfy a difference equation of the form + \f{html}{ + y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k] + \f} - \f[ + \xmlonly y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k] - \f] + \endxmlonly * with the corresponding rational system function + \f{html}{ + H(z) = \ frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}} + \f} - \f[ - H(z) = \frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}} - \f] + \xmlonly + H(z) = \ frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}} + \endxmlonly * Note that some texts define the system function with a + in the denominator. * If you're using that convention, you'll need to negate the feedback taps. diff --git a/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.h b/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.h index 3ce468db2..c330c2140 100644 --- a/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.h +++ b/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.h @@ -40,16 +40,22 @@ gr_make_single_pole_iir_filter_cc (double alpha, unsigned int vlen=1); * \ingroup filter_blk * * The input and output satisfy a difference equation of the form + \f{html}{ + y[n] - (1-alpha) y[n-1] = alpha x[n] + \f} - \f[ + \xmlonly y[n] - (1-alpha) y[n-1] = alpha x[n] - \f] + \endxmlonly * with the corresponding rational system function - - \f[ + \f{html}{ H(z) = \frac{alpha}{1 - (1-alpha) z^{-1}} - \f] + \f} + + \xmlonly + H(z) = \ frac{alpha}{1 - (1-alpha) z^{-1}} + \endxmlonly * Note that some texts define the system function with a + in the denominator. * If you're using that convention, you'll need to negate the feedback tap. diff --git a/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.h b/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.h index d376587df..ee6a554bf 100644 --- a/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.h +++ b/gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.h @@ -39,16 +39,22 @@ gr_make_single_pole_iir_filter_ff (double alpha, unsigned int vlen=1); * \ingroup filter_blk * * The input and output satisfy a difference equation of the form + \f{html}{ + y[n] - (1-alpha) y[n-1] = alpha x[n] + \f} - \f[ + \xmlonly y[n] - (1-alpha) y[n-1] = alpha x[n] - \f] + \endxmlonly * with the corresponding rational system function - - \f[ + \f{html}{ H(z) = \frac{alpha}{1 - (1-alpha) z^{-1}} - \f] + \f} + + \xmlonly +H(z) = \ frac{alpha}{1 - (1-alpha) z^{-1}} + \endxmlonly * Note that some texts define the system function with a + in the denominator. * If you're using that convention, you'll need to negate the feedback tap. -- cgit From 1f0c6eed4cf60929aab39d9cfcc5f3506267b2de Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 6 Feb 2012 17:31:52 -0500 Subject: core: updated missed vfc version of fft block to use nthreads. Also updates copyright dates. --- gnuradio-core/src/lib/general/gr_fft_vcc.cc | 2 +- gnuradio-core/src/lib/general/gr_fft_vcc.h | 2 +- gnuradio-core/src/lib/general/gr_fft_vcc.i | 2 +- gnuradio-core/src/lib/general/gr_fft_vfc.cc | 27 ++++++++++++++++++++++----- gnuradio-core/src/lib/general/gr_fft_vfc.h | 17 +++++++++++++---- gnuradio-core/src/lib/general/gr_fft_vfc.i | 12 +++++++++--- 6 files changed, 47 insertions(+), 15 deletions(-) (limited to 'gnuradio-core/src') diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc.cc b/gnuradio-core/src/lib/general/gr_fft_vcc.cc index 64dda2491..f744acb93 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vcc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc.h b/gnuradio-core/src/lib/general/gr_fft_vcc.h index 6c3985987..ceabeb681 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc.h +++ b/gnuradio-core/src/lib/general/gr_fft_vcc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc.i b/gnuradio-core/src/lib/general/gr_fft_vcc.i index 0dc5353b2..26d8b89a3 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc.i +++ b/gnuradio-core/src/lib/general/gr_fft_vcc.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008,2010 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.cc b/gnuradio-core/src/lib/general/gr_fft_vfc.cc index 561c63740..5fbe732dc 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -40,12 +40,17 @@ gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window) +gr_make_fft_vfc (int fft_size, bool forward, + const std::vector &window, + int nthreads) { - return gnuradio::get_initial_sptr(new gr_fft_vfc (fft_size, forward, window)); + return gnuradio::get_initial_sptr(new gr_fft_vfc (fft_size, forward, + window, nthreads)); } -gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, const std::vector &window) +gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, + const std::vector &window, + int nthreads) : gr_sync_block ("fft_vfc", gr_make_io_signature (1, 1, fft_size * sizeof (float)), gr_make_io_signature (1, 1, fft_size * sizeof (gr_complex))), @@ -56,7 +61,7 @@ gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, const std::vector &wi throw std::invalid_argument ("fft_vfc: forward must == true"); } - d_fft = new gri_fft_complex (d_fft_size, forward); + d_fft = new gri_fft_complex (d_fft_size, forward, nthreads); set_window(window); } @@ -66,6 +71,18 @@ gr_fft_vfc::~gr_fft_vfc () delete d_fft; } +void +gr_fft_vfc::set_nthreads(int n) +{ + d_fft->set_nthreads(n); +} + +int +gr_fft_vfc::nthreads() const +{ + return d_fft->nthreads(); +} + int gr_fft_vfc::work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.h b/gnuradio-core/src/lib/general/gr_fft_vfc.h index 6cf6b9037..84ae08f08 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.h +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,7 +32,9 @@ class gr_fft_vfc; typedef boost::shared_ptr gr_fft_vfc_sptr; GR_CORE_API gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window); +gr_make_fft_vfc (int fft_size, bool forward, + const std::vector &window, + int nthreads=1); /*! * \brief Compute forward FFT. float vector in / complex vector out. @@ -42,17 +44,24 @@ gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window); class GR_CORE_API gr_fft_vfc : public gr_sync_block { friend GR_CORE_API gr_fft_vfc_sptr - gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window); + gr_make_fft_vfc (int fft_size, bool forward, + const std::vector &window, + int nthreads); unsigned int d_fft_size; std::vector d_window; gri_fft_complex *d_fft; - gr_fft_vfc (int fft_size, bool forward, const std::vector &window); + gr_fft_vfc (int fft_size, bool forward, + const std::vector &window, + int nthreads=1); public: ~gr_fft_vfc (); + void set_nthreads(int n); + int nthreads() const; + int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.i b/gnuradio-core/src/lib/general/gr_fft_vfc.i index 149745b58..4783ae1fe 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.i +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,14 +23,20 @@ GR_SWIG_BLOCK_MAGIC(gr, fft_vfc) gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window) +gr_make_fft_vfc (int fft_size, bool forward, + const std::vector &window, + int nthreads=1) throw(std::exception); class gr_fft_vfc : public gr_sync_block { protected: - gr_fft_vfc (int fft_size, bool forward, const std::vector &window); + gr_fft_vfc (int fft_size, bool forward, + const std::vector &window, + int nthreads=1); public: bool set_window(const std::vector &window); + void set_nthreads(int n); + int nthreads() const; }; -- cgit