1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

LadderFilter: Fix incorrect coefficients for BPF12 mode

The implementation follows Valimaki: Oscillator and Filter Algorithms
for Virtual Analog Synthesis (2006). Unlike the other modes, the BPF12
coefficients contained a typo, and had different properties to the other
modes.
This commit is contained in:
attila 2024-08-19 10:18:20 +02:00 committed by Attila Szarvas
parent 402bafda0d
commit c1ae3ab7ae
2 changed files with 26 additions and 1 deletions

View file

@ -1,5 +1,30 @@
# JUCE breaking changes
# develop
## Change
The coefficients of LadderFilter::Mode::BPF12 have been changed, causing a
slight change in the filter's transfer function.
**Possible Issues**
Code that uses the LadderFilter in BPF12 mode may produce different output
samples.
**Workaround**
There is no workaround. If you need this functionality, please let us know
about your use case. In the meantime, you may be able to copy the old class
into your own project/module and use it that way.
**Rationale**
The LadderFilter implementation follows the paper Valimaki (2006): Oscillator
and Filter Algorithms for Virtual Analog Synthesis. The BPF12 mode coefficients
however contained a typo compared to the paper, making the BPF12 mode incorrect.
# Version 8.0.1
## Change

View file

@ -59,7 +59,7 @@ void LadderFilter<SampleType>::setMode (Mode newMode) noexcept
{
case Mode::LPF12: A = {{ SampleType (0), SampleType (0), SampleType (1), SampleType (0), SampleType (0) }}; comp = SampleType (0.5); break;
case Mode::HPF12: A = {{ SampleType (1), SampleType (-2), SampleType (1), SampleType (0), SampleType (0) }}; comp = SampleType (0); break;
case Mode::BPF12: A = {{ SampleType (0), SampleType (0), SampleType (-1), SampleType (1), SampleType (0) }}; comp = SampleType (0.5); break;
case Mode::BPF12: A = {{ SampleType (0), SampleType (1), SampleType (-1), SampleType (0), SampleType (0) }}; comp = SampleType (0.5); break;
case Mode::LPF24: A = {{ SampleType (0), SampleType (0), SampleType (0), SampleType (0), SampleType (1) }}; comp = SampleType (0.5); break;
case Mode::HPF24: A = {{ SampleType (1), SampleType (-4), SampleType (6), SampleType (-4), SampleType (1) }}; comp = SampleType (0); break;
case Mode::BPF24: A = {{ SampleType (0), SampleType (0), SampleType (1), SampleType (-2), SampleType (1) }}; comp = SampleType (0.5); break;