All pastes #804402 Raw Edit

Untitled

public text v1 · immutable
·published 2007-12-03 13:18 UTC
rendered paste body
package evo.audio.util
{
	public class PrecalTableGenerator
	{
		static private var tanhs:Array;
		static public function getTanhTable():Array
		{
			if(tanhs != null)
			{
				return tanhs;
			}
			
			tanhs = new Array(4096);
			for(var i:Number = 0; i<4096;i++)
			{
				var ep:Number = Math.pow(Math.E, 2*((i / 128)-16));
				tanhs[i] = (ep - 1) / (ep + 1);
				trace("i:"+i+" tanh:"+tanhs[i]);
			}
			
			return tanhs
		}
	}
}