// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static final float	PI	= (float) java.lang.Math.PI;
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float atan2(float y, float x);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float cos(float angle);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float princarg(float phase);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float sin(float angle);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float sqrt(float value);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/Disposable.java
// public interface Disposable
// {
// 	void dispose();
// }


import static de.jurihock.voicesmith.dsp.Math.PI;
import static de.jurihock.voicesmith.dsp.Math.atan2;
import static de.jurihock.voicesmith.dsp.Math.cos;
import static de.jurihock.voicesmith.dsp.Math.princarg;
import static de.jurihock.voicesmith.dsp.Math.sin;
import static de.jurihock.voicesmith.dsp.Math.sqrt;
import de.jurihock.voicesmith.Disposable;
		{
			// Get source Re and Im parts
			re = frame[2 * i];
			im = frame[2 * i + 1];

			// Compute source phase
			nextPhaseA = atan2(im, re);

			if (timescaleRatio < 2)
			{
				// Compute phase deltas
				phaseDeltaA = princarg(nextPhaseA - (prevPhaseA[i] + omegaA[i]));
				phaseDeltaS = phaseDeltaA * timescaleRatio;
	
				// Compute destination phase
				nextPhaseS = princarg((prevPhaseS[i] + omegaS[i]) + phaseDeltaS);
	
				// Save computed phase values
				prevPhaseA[i] = nextPhaseA;
				prevPhaseS[i] = nextPhaseS;
			}
			else
			{
				// Compute destination phase
				nextPhaseS = princarg(nextPhaseA * 2);
			}

			// Compute destination Re and Im parts
			abs = sqrt(re * re + im * im);
			re = abs * cos(nextPhaseS);
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static final float	PI	= (float) java.lang.Math.PI;
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float atan2(float y, float x);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float cos(float angle);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float princarg(float phase);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float sin(float angle);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float sqrt(float value);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/Disposable.java
// public interface Disposable
// {
// 	void dispose();
// }


// Path: voicesmith/src/de/jurihock/voicesmith/dsp/processors/TimescaleProcessor.java
import static de.jurihock.voicesmith.dsp.Math.PI;
import static de.jurihock.voicesmith.dsp.Math.atan2;
import static de.jurihock.voicesmith.dsp.Math.cos;
import static de.jurihock.voicesmith.dsp.Math.princarg;
import static de.jurihock.voicesmith.dsp.Math.sin;
import static de.jurihock.voicesmith.dsp.Math.sqrt;
import de.jurihock.voicesmith.Disposable;

		{
			// Get source Re and Im parts
			re = frame[2 * i];
			im = frame[2 * i + 1];

			// Compute source phase
			nextPhaseA = atan2(im, re);

			if (timescaleRatio < 2)
			{
				// Compute phase deltas
				phaseDeltaA = princarg(nextPhaseA - (prevPhaseA[i] + omegaA[i]));
				phaseDeltaS = phaseDeltaA * timescaleRatio;
	
				// Compute destination phase
				nextPhaseS = princarg((prevPhaseS[i] + omegaS[i]) + phaseDeltaS);
	
				// Save computed phase values
				prevPhaseA[i] = nextPhaseA;
				prevPhaseS[i] = nextPhaseS;
			}
			else
			{
				// Compute destination phase
				nextPhaseS = princarg(nextPhaseA * 2);
			}

			// Compute destination Re and Im parts
			abs = sqrt(re * re + im * im);
			re = abs * cos(nextPhaseS);
			im = abs * sin(nextPhaseS);