samplingRate = sampleRate; cutoffFreq = cutFreq; numberOfTaps = numTaps;
    public void init(float sampleRate, float cutFreq, int numTaps, int decimation)    {        float pi = (float)java.lang.Math.PI;        //build the taps, and call super.init(taps[])        float temptaps[] = new float[numberOfTaps];        float m = numberOfTaps -1;        //from Oppenheim and Schafer, m is the order of filter	mDecimation = decimation;        input = new Channel (Float.TYPE, 1+decimation, numTaps);        output = new Channel (Float.TYPE, 1);        //all frequencies are in hz        samplingRate = sampleRate;        cutoffFreq = cutFreq;        numberOfTaps = numTaps;        COEFF = new float[numTaps];        if(cutoffFreq == 0.0)            {                //Using a Hamming window for filter taps:                float tapTotal = 0;                int i;                for(i=0;i<numberOfTaps;i++)                    {                        temptaps[i] = (float)(0.54 - 0.46*java.lang.Math.cos((2*pi)*(i/m)));                        tapTotal += temptaps[i];                    }                //normalize all the taps to a sum of 1                for(i=0;i<numberOfTaps;i++)                    {                        temptaps[i] = temptaps[i]/tapTotal;                    }            }        else{            //ideal lowpass filter ==> Hamming window            //has IR h[n] = sin(omega*n)/(n*pi)            //reference: Oppenheim and Schafer            float w = (2*pi) * cutoffFreq/samplingRate;            int i;            for(i=0;i<numberOfTaps;i++)                {                    //check for div by zero                    if(i-m/2 == 0)                        temptaps[i] = w/pi;                    else                        temptaps[i] = (float)(java.lang.Math.sin(w*(i-m/2)) / pi                                       / (i-m/2) * (0.54 - 0.46                                                    * java.lang.Math.cos((2*pi)*(i/m))));                }        }        COEFF = temptaps;        // Is this actually useful?  StreamIt doesn't like .length,        // and at any rate, COEFF.length will always be numTaps, which        // will always have the same value as numberOfTaps.  --dzm        // numberOfTaps = COEFF.length;    }