1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

DSP: Solved an issue with FilterDesign::designFIRLowpassHalfBandEquirippleMethod for low amplitudedB and normalisationTransitionWidth close to 0.5

This commit is contained in:
Ivan Cohen 2020-12-07 17:01:38 +01:00 committed by reuk
parent b0c8917430
commit b2e49bc7e8
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -279,9 +279,14 @@ typename FIR::Coefficients<FloatType>::Ptr
else
{
auto w01 = std::sqrt (kp * kp + (1 - kp * kp) * std::pow (std::cos (MathConstants<double>::pi / (2.0 * n + 1.0)), 2.0));
auto om01 = std::acos (-w01);
NN = -2.0 * result->getMagnitudeForFrequency (om01 / MathConstants<double>::twoPi, 1.0);
if (std::abs (w01) <= 1.0)
{
auto om01 = std::acos (-w01);
NN = -2.0 * result->getMagnitudeForFrequency (om01 / MathConstants<double>::twoPi, 1.0);
}
else
NN = 2.0 * result->getMagnitudeForFrequency (0.5, 1.0);
}
for (int i = 0; i < hh.size(); ++i)