# In desperate need for help with dsp::IIR::Filter

**URL:** <https://forum.juce.com/t/in-desperate-need-for-help-with-dsp-filter/69784>\
**Category:** Development\
**Created:** [October 26, 2026, 12:30pm UTC](https://forum.juce.com/t/in-desperate-need-for-help-with-dsp-filter/69784 "2026-10-26T12:30:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oxymore](https://avatars.discourse-cdn.com/v4/letter/o/7ea924/32.png) [@Oxymore](https://forum.juce.com/u/Oxymore)\
**Post date:** [October 26, 2026, 12:30pm UTC](https://forum.juce.com/t/in-desperate-need-for-help-with-dsp-filter/69784/1 "2026-10-26T12:30:52Z")

</div>

Hi,

No matter where I look, I find either outdated answers or examples that do not work when I copy them. I really need help to understand how to use an IIR::Filter and how to update its coefficients.

I am trying to make a three bands EQ with simple low shelf and high shelf filters, therefore VariableStateFilter isn’t usable because it lacks said shelf filters. The idea is to simply set the gain and frequency of the low and high bands, it should be very straightforward.

I need a clear example of how to do this in the simplest way. I see ProcessorDuplicator being used in most tutorials yet some features from it seem to have disappeared over time, leaving said tutorials obsolete. I need a 2026 update on the matter.

I thank you in advance, JUCE community.

---

<div class="post-metadata">

**Author:** ![kerfuffle](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kerfuffle/32/11805_2.png) [@kerfuffle](https://forum.juce.com/u/kerfuffle)\
**Post date:** [October 26, 2026, 2:21pm UTC](https://forum.juce.com/t/in-desperate-need-for-help-with-dsp-filter/69784/2 "2026-10-26T14:21:51Z")

</div>

Personally I wouldn’t bother with the JUCE built-in filters. Here’s a simple implementation of Simper’s SVF that has shelving filters: [Cytomic SVF implementation in C++ · GitHub](https://gist.github.com/hollance/2891d89c57adc71d9560bcf0e1e55c4b)

The important thing about using this class is that you need to make one instance for the left channel and another for the right channel.

---

<div class="post-metadata">

**Author:** ![Oxymore](https://avatars.discourse-cdn.com/v4/letter/o/7ea924/32.png) [@Oxymore](https://forum.juce.com/u/Oxymore)\
**Post date:** [October 26, 2026, 2:52pm UTC](https://forum.juce.com/t/in-desperate-need-for-help-with-dsp-filter/69784/3 "2026-10-26T14:52:45Z")

</div>

Thanks a lot, this looks really clean and works per sample just as I needed!

Have a nice day 🙂

---

<div class="post-metadata">

**Author:** ![synthalorian](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@synthalorian](https://forum.juce.com/u/synthalorian)\
**Post date:** [October 29, 2026, 5:14am UTC](https://forum.juce.com/t/in-desperate-need-for-help-with-dsp-filter/69784/4 "2026-10-29T05:14:45Z")

</div>

Glad the SVF works for you. For anyone who lands here looking for the current dsp::IIR way, this compiles against JUCE 8/9:

```
using Filter = juce::dsp::IIR::Filter<float>;
using Coeffs = juce::dsp::IIR::Coefficients<float>;
using Band = juce::dsp::ProcessorDuplicator<Filter, Coeffs>;

juce::dsp::ProcessorChain<Band, Band> chain; // low shelf, high shelf
double sr = 44100.0;

void prepareToPlay (double sampleRate, int blockSize)
{
    sr = sampleRate;
    juce::dsp::ProcessSpec spec { sampleRate, (juce::uint32) blockSize,
                                  (juce::uint32) getTotalNumOutputChannels() };
    updateCoeffs();
    chain.prepare (spec);
}

void updateCoeffs()
{
    using AC = juce::dsp::IIR::ArrayCoefficients<float>;
    *chain.get<0>().state = AC::makeLowShelf (sr, lowFreq, 0.707f, juce::Decibels::decibelsToGain (lowGainDb));
    *chain.get<1>().state = AC::makeHighShelf (sr, highFreq, 0.707f, juce::Decibels::decibelsToGain (highGainDb));
}

void processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer&)
{
    updateCoeffs(); // or only when a parameter changed
    juce::dsp::AudioBlock<float> block (buffer);
    chain.process (juce::dsp::ProcessContextReplacing<float> (block));
}

```

Notes:

- ProcessorDuplicator still has a public `state` member. All channels share that one Coefficients object, and each channel keeps its own filter state.
- Use ArrayCoefficients and assign into the existing state (`*state = ...`). That copies the values in place and doesn’t allocate. The older tutorials do `state = Coefficients::makeLowShelf(...)`, which heap-allocates a new object on the audio thread. That’s the main thing that has changed.
- Gain is a linear factor, not dB.
- Don’t change coefficients too abruptly on a modulated parameter or you’ll get zipper noise. Smooth the gain/freq with SmoothedValue and recompute every N samples if that matters.

---

<div class="post-metadata">

**Author:** ![joeloftus](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@joeloftus](https://forum.juce.com/u/joeloftus)\
**Post date:** [October 29, 2026, 8:08am UTC](https://forum.juce.com/t/in-desperate-need-for-help-with-dsp-filter/69784/5 "2026-10-29T08:08:41Z")

</div>

Sorry, why are you responding to threads with ai responses? Is it to make yourself seem smart or some kind of karma farming? This is a constant occurance on here these days, Sigh.
