Java icon indicating copy to clipboard operation
Java copied to clipboard

Butterworth filter design

Open Martmists-GH opened this issue 3 years ago • 4 comments

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}.

Martmists-GH avatar Oct 11 '22 14:10 Martmists-GH

Sorry for the messy commit history, I forgot to switch back to master before creating the next branch.

Martmists-GH avatar Oct 11 '22 14:10 Martmists-GH

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.

github-actions[bot] avatar Nov 11 '22 00:11 github-actions[bot]

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.

Martmists-GH avatar Nov 14 '22 21:11 Martmists-GH

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.

siriak avatar Nov 15 '22 19:11 siriak

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.

github-actions[bot] avatar Jan 29 '23 00:01 github-actions[bot]

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!

github-actions[bot] avatar Feb 05 '23 00:02 github-actions[bot]