What I'm doing wrong?
The filter works ok, but the harmonic bounces back in the nyquist.
Code: Select all
double in1 = inSample;
double in2 = 0.0;
//double in2 = (lastinput + inSample) / 2.0; lastinput = in1;
in1 = upsampler.process (in1); // a fir filter
in1 = in1 + (in1*in1*0.5);
in1 = downsampler.process (in1); // the same fir filter, but other instance
in2 = upsampler.process (in2);
in2 = in2 + (in2*in2*0.5);
in2 = downsampler.process (in2);
outputSample = in1;