lib/minim/src/ddf/minim/ugens/Wavetable.java
/**
	 * Smooth out the values in the table by using a moving average window.
	 * 
	 * @example Synthesis/WavetableMethods
	 * 
	 * @param windowLength
	 *            int: how many samples large the window should be
	 *            
	 * @related Wavetable
	 */
Smooth out the values in the table by using a moving average window.



@param windowLength
int: how many samples large the window should be

@related Wavetable
Smooth out the values in the table by using a moving average window . @param windowLength int : how many samples large the window should be @related Wavetable
public void smooth(int windowLength)
	{
		if ( windowLength < 1 )
			return;
		float[] temp = (float[])waveform.clone();
		for ( int i = windowLength; i < waveform.length; i++ )
		{
			float avg = 0;
			for ( int j = i - windowLength; j <= i; j++ )
			{
				avg += temp[j] / windowLength;
			}
			waveform[i] = avg;
		}
	}
public void smooth ( int windowLength ) { if ( windowLength < 1 ) return ; float [ ] temp = ( float [ ] ) waveform . clone ( ) ; for ( int i = windowLength ; i < waveform . length ; i ++ ) { float avg = 0 ; for ( int j = i - windowLength ; j <= i ; j ++ ) { avg += temp [ j ] / windowLength ; } waveform [ i ] = avg ; } }
Smooth out the values in the table by using a moving average window.
Smooth out the values in the table by using a moving average window .