Skip to content
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

Subtle bug in ltc_encoder_set_filter() #53

Open
superbigio opened this issue Nov 13, 2019 · 0 comments
Open

Subtle bug in ltc_encoder_set_filter() #53

superbigio opened this issue Nov 13, 2019 · 0 comments

Comments

@superbigio
Copy link

ltc_encoder_set_filter() sets the filter_const field to zero in case rise_time is <= zero.
e->filter_const should be set to 1.0 instead. That's the correct value for the filter constant when no filtering has to take place. Terms will cancel out and your filter equation will return exactly the original sample.
However you are conditionally running your filter loop based on the (wrong) value of the filter constant, so we need to change the condition inside the addvalues() function as well.
if (tcf > 0) should become if (tcf < 1.0)

I realized about this because ltc_encoder_get_filter() kept returning the wrong value for rise_time = 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant