// Filter Definitions var N = 30; // The width of the averaging window function filterTapsGenerator() { // Prepare an array to contain the taps of the filter's impulse response var Taps = new Array(N); // Loop to calculate the filter taps for (var n=0; n<N; n++) { // Calculate the current tap var g_n = 1/N; // Add the current tap to the impulse response array Taps[n] = g_n; } // return the impulse response array return Taps; }