Commit fc88a026 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Fixing gain setting during processing

parent 19b5d70c
......@@ -115,7 +115,7 @@ void CITAIIRFilterEngine::Process( const float* pfInputData, float* pfOutputData
}
for (int j = 0; j < m_oCoeffs.vfNumerator.size(); j++) {
pfOutputData[i] += m_oCoeffs.vfNumerator[j] * m_vfAccumulator[(m_uiCursor + j) % m_vfAccumulator.size()]; //add output sample y(n) += b(j)*v(j)
pfOutputData[ i ] += m_oCoeffs.vfNumerator[ j ] * m_vfAccumulator[ ( m_uiCursor + j ) % m_vfAccumulator.size() ] * fOutputGain; //add output sample y(n) += b(j)*v(j)
}
m_uiCursor = (m_vfAccumulator.size() + m_uiCursor - 1) % m_vfAccumulator.size(); //move the read cursor one space back
......@@ -130,9 +130,9 @@ void CITAIIRFilterEngine::Process( const float* pfInputData, float* pfOutputData
m_vfAccumulator[m_uiCursor] -= m_oCoeffs.vfDenominator[j+1] * m_vfAccumulator[(m_uiCursor + j + 1) % m_vfAccumulator.size()]; //add to the current accumulator v(n) = v(n) - a(j)*v(j)
}
pfOutputData[i] = m_oCoeffs.vfNumerator[0] * m_vfAccumulator[m_uiCursor]; //overrides whatever might have been there already
pfOutputData[ i ] = m_oCoeffs.vfNumerator[ 0 ] * m_vfAccumulator[ m_uiCursor ] * fOutputGain; //overrides whatever might have been there already
for (int j = 1; j < m_oCoeffs.vfNumerator.size(); j++) {
pfOutputData[i] += m_oCoeffs.vfNumerator[j] * m_vfAccumulator[(m_uiCursor + j) % m_vfAccumulator.size()]; //add output sample y(n) += b(j)*v(j)
pfOutputData[ i ] += m_oCoeffs.vfNumerator[ j ] * m_vfAccumulator[ ( m_uiCursor + j ) % m_vfAccumulator.size() ] * fOutputGain; //add output sample y(n) += b(j)*v(j)
}
m_uiCursor = (m_vfAccumulator.size() + m_uiCursor - 1) % m_vfAccumulator.size(); //move the read cursor one space back
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment