I use the polyphase filters from the musicdsp.org archive..
here is the code for 4x oversampling as it is atm:
Code: Select all
inline void process4x(double& sample)
{
a = halfband[0]->process( sample );
a = halfband[2]->process( a );
a = effect.process ( a * 4.0);
a = halfband[3]->process ( a );
a = halfband[2]->process ( null );
a = effect.process ( a * 4.0);
a = halfband[3]->process ( a );
a = halfband[1]->process( a );
sample = a; //Decimate
a = halfband[0]->process( null );
a = halfband[2]->process( a );
a = effect.process ( a * 4.0);
a = halfband[3]->process ( a );
a = halfband[2]->process ( null );
a = effect.process ( a * 4.0);
a = halfband[3]->process ( a );
a = halfband[1]->process( a );
}
Is this a correct way to do it?