Open
Conversation
Add rate-dependent configuration to Interpolator and use it in Sinc to apply an anti-aliasing bandwidth when downsampling. The Interpolator trait now exposes set_hz_to_hz, set_playback_hz_scale, and set_sample_hz_scale (default no-ops); Converter methods call them automatically. Fixes #174
There was a problem hiding this comment.
Pull request overview
This PR fixes aliasing issues in the Sinc interpolator during downsampling by introducing rate-dependent configuration. The changes allow the Sinc interpolator to automatically adjust its anti-aliasing bandwidth based on the sample rate conversion ratio.
Changes:
- Extended the
Interpolatortrait with three rate configuration methods (set_hz_to_hz,set_playback_hz_scale,set_sample_hz_scale) with default no-op implementations - Modified the
Sincinterpolator to store and apply a bandwidth parameter for anti-aliasing - Updated
Convertermethods to automatically configure interpolators with rate information - Added a test to verify anti-aliasing works correctly during downsampling
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| dasp_interpolate/src/lib.rs | Added rate configuration methods to the Interpolator trait with comprehensive documentation |
| dasp_interpolate/src/sinc/mod.rs | Added bandwidth field and implemented rate configuration methods to apply anti-aliasing |
| dasp_signal/src/interpolate.rs | Modified from_hz_to_hz constructor and setter methods to call interpolator rate configuration |
| dasp_signal/tests/interpolate.rs | Added test verifying anti-aliasing filters out frequencies above Nyquist during downsampling |
| CHANGELOG.md | Documented the changes and additions to the API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
Converted to draft: spectrogram reveals that it's got some issues. |
395163e to
f2f0197
Compare
Member
Author
|
There, that should be better. |
f2f0197 to
9668870
Compare
a38546d to
b94688e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add rate-dependent configuration to
Interpolatorand use it in Sinc to apply an anti-aliasing bandwidth when downsampling. TheInterpolatortrait now exposesset_hz_to_hz,set_playback_hz_scale, andset_sample_hz_scale(default no-ops). TheConvertermethods call them automatically, without API breakage.Fixes #174