Fix adaptive frequency bounds#284
Draft
Erikpostt wants to merge 8 commits into
Draft
Conversation
- Add sampling_frequency property with setter to IMUConfig - Implement _update_frequency_dependent_params() virtual method - Override in GaitConfig: auto-clamp spectrum_high_frequency and mfcc_high_frequency to Nyquist - Override in TremorConfig: auto-clamp fmax_peak_search and fmax_mfcc to Nyquist - Add warnings when frequency bounds are clamped for safety - Fixes issue where 50Hz/64Hz data caused 'out of bounds' errors in feature extraction This allows users to set sampling_frequency at any point and freq-dependent params adapt automatically, preventing Nyquist violations without manual config management.
…ss initialization This fixes the initialization order bug where the update method was being called in IMUConfig.__init__() before subclass attributes like mfcc_high_frequency were set. Solution: defer calls until the end of GaitConfig and TremorConfig __init__. The property setter still works for post-initialization frequency changes, and the virtual method pattern correctly updates all bounds when sampling_frequency changes at any point in the config lifecycle. Verified with test_adaptive_frequencies_demo.py - all 3 tests pass.
- Remove test_adaptive_frequencies_demo.py (development validation only) - Remove implementation notes from IMUConfig (internal architectural detail) - Keep core adaptive frequency bounds implementation clean for production Commit validates that all 3 frequency test cases (50/64/100 Hz) pass successfully.
…fix-adaptive-frequency-bounds
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.
Description
Describe the purpose of this pull request. Also link any related issues.
Changes
List the changes you have made.
Additional Information
Include any additional information, such as how to test your changes.
Checklist