void EngineFilterButterworth8Low::process(const CSAMPLE *pIn, const CSAMPLE *ppOut, const int iBufferSize) { CSAMPLE *pOutput = (CSAMPLE *)ppOut; for (int i=0; i < iBufferSize; i += 2) { pOutput[i] = _processLowpass(m_coef, m_buf1, pIn[i]); pOutput[i+1] = _processLowpass(m_coef, m_buf2, pIn[i+1]); } zap_buffer_denormals(m_buf1, m_bufSize); zap_buffer_denormals(m_buf2, m_bufSize); }
void EngineFilterButterworth8Band::process(const CSAMPLE *pIn, const CSAMPLE *ppOut, const int iBufferSize) { CSAMPLE *pOutput = (CSAMPLE *)ppOut; for (int i=0; i < iBufferSize; i += 2) { pOutput[i] = _processBandpass(m_coef, m_buf1, pIn[i]); pOutput[i+1] = _processBandpass(m_coef, m_buf2, pIn[i+1]); if(pOutput[i] != pOutput[i]) //Check for NaN pOutput[i] = 0; if(pOutput[i+1] != pOutput[i+1]) //Check for NaN pOutput[i+1] = 0; } zap_buffer_denormals(m_buf1, m_bufSize); zap_buffer_denormals(m_buf2, m_bufSize); }
void EngineFilterButterworth8::process(const CSAMPLE *pIn, const CSAMPLE *ppOut, const int iBufferSize) { CSAMPLE * pOutput = (CSAMPLE *)ppOut; switch(m_type) { case FILTER_LOWPASS: for(int i=0; i < iBufferSize; i += 2) { pOutput[i] = _processLowpass(m_coef, m_buf1, pIn[i]); pOutput[i+1] = _processLowpass(m_coef, m_buf2, pIn[i+1]); } break; case FILTER_BANDPASS: for(int i=0; i < iBufferSize; i += 2) { pOutput[i] = _processBandpass(m_coef, m_buf1, pIn[i]); pOutput[i+1] = _processBandpass(m_coef, m_buf2, pIn[i+1]); if(pOutput[i] != pOutput[i]) //Check for NaN pOutput[i] = 0; if(pOutput[i+1] != pOutput[i+1]) //Check for NaN pOutput[i+1] = 0; } break; case FILTER_HIGHPASS: for(int i=0; i < iBufferSize; i += 2) { pOutput[i] = _processHighpass(m_coef, m_buf1, pIn[i]); pOutput[i+1] = _processHighpass(m_coef, m_buf2, pIn[i+1]); } break; } zap_buffer_denormals(m_buf1, m_bufSize); zap_buffer_denormals(m_buf2, m_bufSize); }