-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First Order High-pass and Low-pass filters for Sensors #6695
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #6695 +/- ##
==========================================
+ Coverage 53.70% 53.90% +0.19%
==========================================
Files 50 50
Lines 9408 9623 +215
Branches 1654 1698 +44
==========================================
+ Hits 5053 5187 +134
- Misses 4056 4112 +56
- Partials 299 324 +25 ☔ View full report in Codecov by Sentry. |
Hey there @esphome/core, mind taking a look at this pull request as it has been labeled with an integration ( |
Had you considered generalising this to allow higher-order filters? |
@clydebarrow When I made these simple 1st order HPF/LPF I actually thought it might be generalized and made configurable. I might actually to come up with the updated generic dsp filter component so we can review. Its not the rocket science, question is usability. maybe several separate specific components might be easier to use... maybe not. like 1st_hpf, 1st_lpf, 2nd_hpf, 1st_butterworth, etc. Ideas, thoughts? |
What does this implement/fix?
This implements simple but very useful first-order High-pass and Low-pass filters.
High-pass - removing static offset and reduce low-freq noise.
y[i] := α × (y[i−1] + x[i] − x[i−1])
Low-pass - reducing high-freq noise on signals.
y[i] := y[i-1] + α * (x[i] - y[i-1])
Types of changes
Related issue or feature (if applicable): fixes esphome/feature-requests#2705
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#3875
Test Environment
Example entry for
config.yaml
:Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: