Butterworth filter design
Describe your change:
- [x] Add an algorithm?
- [ ] Fix a bug or typo in an existing algorithm?
- [ ] Documentation change?
References
#3494
Checklist:
- [x] I have read CONTRIBUTING.md.
- [x] This pull request is all my own work -- I have not plagiarized.
- [x] I know that pull requests will not be merged if they fail the automated tests.
- [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
- [x] All new Java files are placed inside an existing directory.
- [x] All filenames are in all uppercase characters with no spaces or dashes.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
- [x] If this pull request resolves one or more open issues then the commit message contains
Fixes: #{$ISSUE_NO}.
Sorry for the messy commit history, I forgot to switch back to master before creating the next branch.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
How would you imagine I implement unit tests for filters? Should I evaluate the frequency response of the filter and see if it approximates the expected curve? That should probably be a separate algorithm. Should I push some samples through it? I'm not sure how to deal with the floating point accuracy, nor how this effectively tests the filter.
You could check that data points withing the passband are relatively unchanged, while data points outside of it are relatively suppressed. For floating point values, it's sufficient to check that they are withing (expected - epsilon; expected + epsilon) where epsilon is basically a small number, say a power of 10. Which one is up to you. And as for transition from passband to suppressed frequencies, it's safe to ignore it.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!