mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 07:04:01 -06:00
graph_accelerometer: Support axis-level comparison of adxl345 data
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
This commit is contained in:
parent
b6908e56aa
commit
2d8945dc1c
2 changed files with 8 additions and 3 deletions
|
@ -139,6 +139,8 @@ class CalibrationData:
|
|||
self.psd_y = psd_y
|
||||
self.psd_z = psd_z
|
||||
self._psd_list = [self.psd_sum, self.psd_x, self.psd_y, self.psd_z]
|
||||
self._psd_map = {'x': self.psd_x, 'y': self.psd_y, 'z': self.psd_z,
|
||||
'all': self.psd_sum}
|
||||
self.data_sets = 1
|
||||
def join(self, other):
|
||||
np = self.numpy
|
||||
|
@ -159,6 +161,8 @@ class CalibrationData:
|
|||
psd /= self.freq_bins + .1
|
||||
# Remove low-frequency noise
|
||||
psd[self.freq_bins < MIN_FREQ] = 0.
|
||||
def get_psd(self, axis='all'):
|
||||
return self._psd_map[axis]
|
||||
|
||||
|
||||
CalibrationResult = collections.namedtuple(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue