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
"""
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.
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.