mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-12-16 05:09:56 +01:00
sosfilter: handle high order butter filters
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
committed by
KevinOConnor
parent
900c908db8
commit
a9cf02c412
@@ -35,10 +35,10 @@ class DigitalFilter:
|
||||
except:
|
||||
raise cfg_error("DigitalFilter require the SciPy module")
|
||||
if highpass:
|
||||
self.filter_sections.append(
|
||||
self.filter_sections.extend(
|
||||
self._butter(highpass, "highpass", highpass_order))
|
||||
if lowpass:
|
||||
self.filter_sections.append(
|
||||
self.filter_sections.extend(
|
||||
self._butter(lowpass, "lowpass", lowpass_order))
|
||||
if notches is None:
|
||||
notches = []
|
||||
@@ -50,7 +50,7 @@ class DigitalFilter:
|
||||
def _butter(self, frequency, btype, order):
|
||||
import scipy.signal as signal
|
||||
return signal.butter(order, Wn=frequency, btype=btype,
|
||||
fs=self.sample_frequency, output='sos')[0]
|
||||
fs=self.sample_frequency, output='sos')
|
||||
|
||||
def _notch(self, freq, quality):
|
||||
import scipy.signal as signal
|
||||
|
||||
Reference in New Issue
Block a user