예제 #1
0
void AnalogFilter::filterout (REALTYPE *smp, int numSamples)
{
    int i;

    if (needsinterpolation != 0)
    {
        for (i = 0; i < numSamples; i++)
            ismp[i] = smp[i];
        for (i = 0; i < stages + 1; i++)
            singlefilterout (ismp, oldx[i], oldy[i], oldc, oldd, numSamples);
    }

    for (i = 0; i < stages + 1; i++)
        singlefilterout (smp, x[i], y[i], c, d, numSamples);

    if (needsinterpolation != 0)
    {
        for (i = 0; i < numSamples; i++)
        {
            REALTYPE x = i / (REALTYPE) numSamples;
            smp[i] = ismp[i] * (1.0 - x) + smp[i] * x;
        }
        needsinterpolation = 0;
    }

    for (i = 0; i < numSamples; i++) smp[i] *= outgain;
}
예제 #2
0
void
filterout (ZEq10ban_t * s, AnalogFilter *filter, float * smp, unsigned long count)
{
  int i;
  if (filter->needsinterpolation != 0)
    {
      for (i = 0; i < count; i++)
	filter->ismp[i] = smp[i];
      for (i = 0; i < filter->stages + 1; i++)
	singlefilterout (s,filter,filter->ismp, &filter->oldx[i], &filter->oldy[i],filter->oldc, filter->oldd, count);
    };

  for (i = 0; i < filter->stages + 1; i++)
    singlefilterout (s,filter,smp, &filter->x[i], &filter->y[i], filter->c, filter->d,count);

  if (filter->needsinterpolation != 0)
    {
      for (i = 0; i < count; i++)
	{
	  float x = i / (float) count;
	  smp[i] = filter->ismp[i] * (1.0 - x) + smp[i] * x;
	};
      filter->needsinterpolation = 0;
    };

  for (i = 0; i < count; i++)
    smp[i] *= filter->outgain;
};
예제 #3
0
void
RBFilter::filterout (float * smp)
{
    int i;
    float *ismp = NULL;

    if (needsinterpolation != 0) {
        ismp = new float[param->PERIOD+1];
        for (i = 0; i < param->PERIOD; i++)
            ismp[i] = smp[i];
        for (i = 0; i < stages + 1; i++)
            singlefilterout (ismp, st[i], ipar);

        delete (ismp);
        needsinterpolation = 0;
    };

    for (i = 0; i < stages + 1; i++)
        singlefilterout (smp, st[i], par);


    for (i = 0; i < param->PERIOD; i++)
        smp[i] *= outgain;

};
예제 #4
0
void
AnalogFilter::filterout (float * smp)
{
  int i;
  float *ismp = NULL;	//used if it needs interpolation
  if (needsinterpolation != 0)
    {
      ismp = new float[PERIOD];
      for (i = 0; i < PERIOD; i++)
	ismp[i] = smp[i];
      for (i = 0; i < stages + 1; i++)
	singlefilterout (ismp, oldx[i], oldy[i], oldc, oldd);
    };

  for (i = 0; i < stages + 1; i++)
    singlefilterout (smp, x[i], y[i], c, d);

  if (needsinterpolation != 0)
    {
      for (i = 0; i < PERIOD; i++)
	{
	  float x = (float) i / fPERIOD;
	  smp[i] = ismp[i] * (1.0f - x) + smp[i] * x;
	};
      delete (ismp);
      needsinterpolation = 0;
    };

};
예제 #5
0
void AnalogFilter::filterout(REALTYPE *smp)
{
    REALTYPE *ismp = NULL; //used if it needs interpolation
    int i;
    if(needsinterpolation != 0) {
        ismp = new REALTYPE[SOUND_BUFFER_SIZE];
        for(i = 0; i < SOUND_BUFFER_SIZE; i++)
            ismp[i] = smp[i];
        for(i = 0; i < stages + 1; i++)
            singlefilterout(ismp, oldx[i], oldy[i], oldc, oldd);
    }

    for(i = 0; i < stages + 1; i++)
        singlefilterout(smp, x[i], y[i], c, d);

    if(needsinterpolation != 0) {
        for(i = 0; i < SOUND_BUFFER_SIZE; i++) {
            REALTYPE x = i / (REALTYPE) SOUND_BUFFER_SIZE;
            smp[i] = ismp[i] * (1.0 - x) + smp[i] * x;
        }
        delete [] ismp;
        needsinterpolation = 0;
    }

    for(i = 0; i < SOUND_BUFFER_SIZE; i++)
        smp[i] *= outgain;
}
예제 #6
0
void SVFilter::filterout(REALTYPE *smp)
{
  int i;
  REALTYPE x;

  if (needsinterpolation != 0)
  {
    for (i = 0 ; i < SOUND_BUFFER_SIZE ; i++)
    {
      m_ismp[i] = smp[i];
    }

    for (i=0 ; i < stages + 1 ; i++)
    {
      singlefilterout(m_ismp, st[i], ipar);
    }
  }

  for (i = 0 ; i < stages + 1 ; i++)
  {
    singlefilterout(smp, st[i], par);
  }

  if (needsinterpolation != 0)
  {
    for (i = 0 ; i < SOUND_BUFFER_SIZE ; i++)
    {
      x = i / (REALTYPE)SOUND_BUFFER_SIZE;
      smp[i] = m_ismp[i] * (1.0 - x) + smp[i] * x;
    }

    needsinterpolation = 0;
  }

  for (i = 0 ; i < SOUND_BUFFER_SIZE ; i++)
  {
    smp[i] *= m_outgain;
  }
}
예제 #7
0
파일: SVFilter.cpp 프로젝트: discokid/Carla
void SVFilter::filterout(float *smp)
{
    for(int i = 0; i < stages + 1; ++i)
        singlefilterout(smp, st[i], par);

    if(needsinterpolation) {
        float ismp[buffersize];
        memcpy(ismp, smp, bufferbytes);

        for(int i = 0; i < stages + 1; ++i)
            singlefilterout(ismp, st[i], ipar);

        for(int i = 0; i < buffersize; ++i) {
            float x = i / buffersize_f;
            smp[i] = ismp[i] * (1.0f - x) + smp[i] * x;
        }
        needsinterpolation = false;
    }

    for(int i = 0; i < buffersize; ++i)
        smp[i] *= outgain;
}
예제 #8
0
파일: RBFilter.C 프로젝트: NY-tram/rkrlv2
void
RBFilter::filterout (float * smp, uint32_t period)
{
    unsigned int i;

    if (needsinterpolation != 0) {
        for (i = 0; i < period; i++)
            ismp[i] = smp[i];
        for (i = 0; i < stages + 1; i++)
            singlefilterout (ismp, st[i], ipar, period);

        needsinterpolation = 0;
    };

    for (i = 0; i < stages + 1; i++)
        singlefilterout (smp, st[i], par, period);


    for (i = 0; i < period; i++)
        smp[i] *= outgain;

};
예제 #9
0
void SVFilter::filterout(float *smp)
{
    for(int i = 0; i < stages + 1; ++i)
        singlefilterout(smp, st[i], par);

    if(needsinterpolation) {
        float *ismp = getTmpBuffer();
        memcpy(ismp, smp, synth->bufferbytes);

        for(int i = 0; i < stages + 1; ++i)
            singlefilterout(ismp, st[i], ipar);

        for(int i = 0; i < synth->buffersize; ++i) {
            float x = i / synth->buffersize_f;
            smp[i] = ismp[i] * (1.0f - x) + smp[i] * x;
        }
        returnTmpBuffer(ismp);
        needsinterpolation = false;
    }

    for(int i = 0; i < synth->buffersize; ++i)
        smp[i] *= outgain;
}
예제 #10
0
void AnalogFilter::filterout(float *smp)
{
    for(int i = 0; i < stages + 1; ++i)
        singlefilterout(smp, history[i], coeff);

    if(needsinterpolation) {
        //Merge Filter at old coeff with new coeff
        float ismp[buffersize];
        memcpy(ismp, smp, bufferbytes);

        for(int i = 0; i < stages + 1; ++i)
            singlefilterout(ismp, oldHistory[i], oldCoeff);

        for(int i = 0; i < buffersize; ++i) {
            float x = (float)i / buffersize_f;
            smp[i] = ismp[i] * (1.0f - x) + smp[i] * x;
        }
        needsinterpolation = false;
    }

    for(int i = 0; i < buffersize; ++i)
        smp[i] *= outgain;
}
예제 #11
0
파일: SVFilter.C 프로젝트: rsenn/eXT2
void SVFilter::filterout(REALTYPE *smp) {
    int i;
    REALTYPE *ismp=NULL;

    if (needsinterpolation!=0) {
        ismp=new REALTYPE[SOUND_BUFFER_SIZE];
        for (i=0; i<SOUND_BUFFER_SIZE; i++) ismp[i]=smp[i];
        for (i=0; i<stages+1; i++) singlefilterout(ismp,st[i],ipar);
    };

    for (i=0; i<stages+1; i++) singlefilterout(smp,st[i],par);

    if (needsinterpolation!=0) {
        for (i=0; i<SOUND_BUFFER_SIZE; i++) {
            REALTYPE x=i/(REALTYPE) SOUND_BUFFER_SIZE;
            smp[i]=ismp[i]*(1.0-x)+smp[i]*x;
        };
        delete (ismp);
        needsinterpolation=0;
    };

    for (i=0; i<SOUND_BUFFER_SIZE; i++) smp[i]*=outgain;

};