summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnuradio-core/src/lib/filter/gr_iir_filter_ffd.h16
-rw-r--r--gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.h16
-rw-r--r--gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.h16
-rw-r--r--gnuradio-core/src/lib/general/gr_fft_vcc.cc2
-rw-r--r--gnuradio-core/src/lib/general/gr_fft_vcc.h2
-rw-r--r--gnuradio-core/src/lib/general/gr_fft_vcc.i2
-rw-r--r--gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc2
-rw-r--r--gnuradio-core/src/lib/general/gr_fft_vfc.cc27
-rw-r--r--gnuradio-core/src/lib/general/gr_fft_vfc.h17
-rw-r--r--gnuradio-core/src/lib/general/gr_fft_vfc.i12
-rw-r--r--grc/blocks/gr_fft_filter_xxx.xml9
-rw-r--r--grc/blocks/gr_fft_vxx.xml11
12 files changed, 98 insertions, 34 deletions
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<double> &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.
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_vcc_fftw.cc b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc
index e6032ad9e..a99beb965 100644
--- a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc
+++ b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc
@@ -85,7 +85,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 (int i = 0; i < offset; i++) // apply window
dst[i+fft_m_offset] = in[i] * d_window[i];
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<float> &window)
+gr_make_fft_vfc (int fft_size, bool forward,
+ const std::vector<float> &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<float> &window)
+gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward,
+ const std::vector<float> &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<float> &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> gr_fft_vfc_sptr;
GR_CORE_API gr_fft_vfc_sptr
-gr_make_fft_vfc (int fft_size, bool forward, const std::vector<float> &window);
+gr_make_fft_vfc (int fft_size, bool forward,
+ const std::vector<float> &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<float> &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<float> &window);
+ gr_make_fft_vfc (int fft_size, bool forward,
+ const std::vector<float> &window,
+ int nthreads);
unsigned int d_fft_size;
std::vector<float> d_window;
gri_fft_complex *d_fft;
- gr_fft_vfc (int fft_size, bool forward, const std::vector<float> &window);
+ gr_fft_vfc (int fft_size, bool forward,
+ const std::vector<float> &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<float> &window)
+gr_make_fft_vfc (int fft_size, bool forward,
+ const std::vector<float> &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<float> &window);
+ gr_fft_vfc (int fft_size, bool forward,
+ const std::vector<float> &window,
+ int nthreads=1);
public:
bool set_window(const std::vector<float> &window);
+ void set_nthreads(int n);
+ int nthreads() const;
};
diff --git a/grc/blocks/gr_fft_filter_xxx.xml b/grc/blocks/gr_fft_filter_xxx.xml
index c1633094b..5b4cd83cc 100644
--- a/grc/blocks/gr_fft_filter_xxx.xml
+++ b/grc/blocks/gr_fft_filter_xxx.xml
@@ -9,8 +9,9 @@
<key>gr_fft_filter_xxx</key>
<import>from gnuradio import gr</import>
<import>from gnuradio.gr import firdes</import>
- <make>gr.fft_filter_$(type)($decim, $taps)</make>
+ <make>gr.fft_filter_$(type)($decim, $taps, $nthreads)</make>
<callback>set_taps($taps)</callback>
+ <callback>set_nthreads($nthreads)</callback>
<param>
<name>Type</name>
<key>type</key>
@@ -41,6 +42,12 @@
<key>taps</key>
<type>$type.taps</type>
</param>
+ <param>
+ <name>Num. Threads</name>
+ <key>nthreads</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
<sink>
<name>in</name>
<type>$type.input</type>
diff --git a/grc/blocks/gr_fft_vxx.xml b/grc/blocks/gr_fft_vxx.xml
index d398486ef..565354e41 100644
--- a/grc/blocks/gr_fft_vxx.xml
+++ b/grc/blocks/gr_fft_vxx.xml
@@ -10,10 +10,11 @@
<import>from gnuradio import gr</import>
<import>from gnuradio import window</import>
<make>#if $type() == "complex"
-gr.fft_vcc($fft_size, $forward, $window, $shift)
+gr.fft_vcc($fft_size, $forward, $window, $shift, $nthreads)
#else
-gr.fft_vfc($fft_size, $forward, $window)
+gr.fft_vfc($fft_size, $forward, $window, $nthreads)
#end if</make>
+ <callback>set_nthreads($nthreads)</callback>
<param>
<name>Input Type</name>
<key>type</key>
@@ -68,6 +69,12 @@ gr.fft_vfc($fft_size, $forward, $window)
<key>False</key>
</option>
</param>
+ <param>
+ <name>Num. Threads</name>
+ <key>nthreads</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
<sink>
<name>in</name>
<type>$type</type>