Skip to content

Commit

Permalink
Correct result when taps is odd
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPeaboss committed Oct 17, 2024
1 parent d012675 commit 32f439d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sinc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl Converter {
let mut right;
if taps % 2 == 1 {
let pos = coef * self.quan;
let posu = coef as usize;
let posu = pos as usize;
let h1 = self.filter[posu];
let h2 = self.filter[posu + 1];
let h = h1 + (h2 - h1) * (pos - posu as f64);
Expand Down

0 comments on commit 32f439d

Please sign in to comment.