processSingleSampleRaw doubles frequency?


#1

Using IIRFilter::processSingleSampleRaw vs IIRFilter::processSamples appears to change the frequency

I’m not really sure how I could be misusing this, but I’d be surprised if I’m the first person to hit it.

For example:

if (*processSingle){
    //this path appears to double the affected frequency
    for (int x = 0; x < buffer.getNumSamples(); x++) {
        leftData[x] = filterAPeak.processSingleSampleRaw (leftData[x]);
        rightData[x] = filterAPeak.processSingleSampleRaw (rightData[x]);
    }
}
else
{
    //This works as expected
    filterAPeak.processSamples (leftData, buffer.getNumSamples());
   filterAPeak.processSamples (rightData, buffer.getNumSamples());
}

First path produces:

Second path produces:

IIRCoefficients are the same in both cases. Full test case code is at: https://gitlab.com/dave.ursa/PeakFilterIssue

Can anyone confirm / point out what I’ve missed?


#2

You need two filter objects to process two channels of audio.


#3

Well, would you just look at that :blush:

Much obliged, pflugshaupt