summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/python
diff options
context:
space:
mode:
authorjblum2008-08-06 20:11:53 +0000
committerjblum2008-08-06 20:11:53 +0000
commit2105e82eb7d5cf5e5f44d3603c0111eecfaebe40 (patch)
tree7f565a06a9b3656bae60ffcda1d869d66358234c /gnuradio-core/src/python
parent7de54eabe4405115d51fdf52905f794b5131ca10 (diff)
downloadgnuradio-2105e82eb7d5cf5e5f44d3603c0111eecfaebe40.tar.gz
gnuradio-2105e82eb7d5cf5e5f44d3603c0111eecfaebe40.tar.bz2
gnuradio-2105e82eb7d5cf5e5f44d3603c0111eecfaebe40.zip
set decim
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9194 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/python')
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py19
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py16
2 files changed, 34 insertions, 1 deletions
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py b/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py
index e96159f1d..d10246cfe 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py
@@ -65,6 +65,13 @@ class _logpwrfft_base(gr.hier_block2):
self.set_avg_alpha(avg_alpha)
self.set_average(average)
+ def set_decimation(self, decim):
+ """!
+ Set the decimation on stream decimator.
+ @param decim the new decimation
+ """
+ self._sd.set_decimation(decim)
+
def set_sample_rate(self, sample_rate):
"""!
Set the new sampling rate
@@ -97,6 +104,18 @@ class _logpwrfft_base(gr.hier_block2):
"""
return self._sd.sample_rate()
+ def decimation(self):
+ """!
+ Return the current decimation.
+ """
+ return self._sd.decimation()
+
+ def frame_rate(self):
+ """!
+ Return the current frame rate.
+ """
+ return self._sd.frame_rate()
+
def average(self):
"""!
Return whether or not averaging is being performed.
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py b/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py
index ff3a6b955..17dd67ded 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py
@@ -63,10 +63,24 @@ class stream_to_vector_decimator(gr.hier_block2):
self._vec_rate = vec_rate
self._update_decimator()
+ def set_decimation(self, decim):
+ """!
+ Set the decimation parameter directly.
+ @param decim the new decimation
+ """
+ self._decim = max(1, int(round(decim)))
+ self.one_in_n.set_n(self._decim)
+
def _update_decimator(self):
- self._decim = max(1, int(self._sample_rate/self._vec_len/self._vec_rate))
+ self._decim = max(1, int(round(self._sample_rate/self._vec_len/self._vec_rate)))
self.one_in_n.set_n(self._decim)
+ def decimation(self):
+ """!
+ Returns the actual decimation.
+ """
+ return self._decim
+
def sample_rate(self):
"""!
Returns configured sample rate.