commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r9194 - gnuradio/trunk/gnuradio-core/src/python/gnurad


From: jblum
Subject: [Commit-gnuradio] r9194 - gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl
Date: Wed, 6 Aug 2008 14:11:54 -0600 (MDT)

Author: jblum
Date: 2008-08-06 14:11:53 -0600 (Wed, 06 Aug 2008)
New Revision: 9194

Modified:
   gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py
   
gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py
Log:
set decim

Modified: 
gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py
===================================================================
--- gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py     
2008-08-06 17:43:18 UTC (rev 9193)
+++ gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py     
2008-08-06 20:11:53 UTC (rev 9194)
@@ -65,6 +65,13 @@
         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 @@
         """
         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.

Modified: 
gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py
===================================================================
--- 
gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py
    2008-08-06 17:43:18 UTC (rev 9193)
+++ 
gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py
    2008-08-06 20:11:53 UTC (rev 9194)
@@ -63,10 +63,24 @@
         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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]