diff options
author | Chris Robinson <[email protected]> | 2017-08-17 05:53:16 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-08-17 05:53:16 -0700 |
commit | 3f3a3ac4f1d069542ca2399a8b5e63d9d1a4df3b (patch) | |
tree | 9eb4f5b7802312dd273299da9dd81a946c79e242 /utils | |
parent | 9fd3e5f52933de4c413784d04cc6196cd18b116e (diff) |
Properly calculate the filter size
Diffstat (limited to 'utils')
-rw-r--r-- | utils/makehrtf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/makehrtf.c b/utils/makehrtf.c index 963528bb..c9c2d10c 100644 --- a/utils/makehrtf.c +++ b/utils/makehrtf.c @@ -1296,10 +1296,11 @@ static void ResamplerSetup(ResamplerT *rs, const uint srcRate, const uint dstRat cutoff = 0.475 / rs->mQ; width = 0.05 / rs->mQ; } - // A rejection of -180 dB is used for the stop band. - l = CalcKaiserOrder(180.0, width) / 2; + // A rejection of -180 dB is used for the stop band. Round up the order to + // keep the transition width from growing. + l = (CalcKaiserOrder(180.0, width)+1) / 2; beta = CalcKaiserBeta(180.0); - rs->mM = (2 * l) + 1; + rs->mM = (l+1) * 2; rs->mL = l; rs->mF = CreateArray(rs->mM); for(i = 0;i < ((int)rs->mM);i++) |