mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-12-25 09:08:33 -07:00
sosfilter: handle high order butter filters
Some checks are pending
Build test / build (push) Waiting to run
Some checks are pending
Build test / build (push) Waiting to run
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
parent
900c908db8
commit
a9cf02c412
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue