// 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 abs(float real, float imag);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float arg(float real, float imag);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float imag(float abs, float arg);
// 
// 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 real(float abs, float arg);


import static de.jurihock.voicesmith.dsp.Math.PI;
import static de.jurihock.voicesmith.dsp.Math.abs;
import static de.jurihock.voicesmith.dsp.Math.arg;
import static de.jurihock.voicesmith.dsp.Math.imag;
import static de.jurihock.voicesmith.dsp.Math.princarg;
import static de.jurihock.voicesmith.dsp.Math.real;
	{
		final int fftSize = frame.length / 2;
		float re, im, abs, nextPhase, phaseDelta;

		for (int i = 1; i < fftSize; i++)
		{
			// Get source Re and Im parts
			re = frame[2 * i];
			im = frame[2 * i + 1];
			abs = abs(re, im);

			// Invert phase value
			nextPhase = arg(re, im);

			// Compute phase delta
			phaseDelta = princarg(nextPhase - 2F * prevPhase1[i] + prevPhase2[i]);
			
			// Disable some frequency components
			if(Math.abs(phaseDelta) > 0.05F * omega[i])
			{
				abs = 0;
				nextPhase = 0;
			}
			
			// Save phase values
			prevPhase2[i] = prevPhase1[i];
			prevPhase1[i] = nextPhase;

			// Compute destination Re and Im parts
			frame[2 * i] = real(abs, nextPhase);
// 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 abs(float real, float imag);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float arg(float real, float imag);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float imag(float abs, float arg);
// 
// 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 real(float abs, float arg);


// Path: voicesmith/src/de/jurihock/voicesmith/dsp/processors/SeparationProcessor.java
import static de.jurihock.voicesmith.dsp.Math.PI;
import static de.jurihock.voicesmith.dsp.Math.abs;
import static de.jurihock.voicesmith.dsp.Math.arg;
import static de.jurihock.voicesmith.dsp.Math.imag;
import static de.jurihock.voicesmith.dsp.Math.princarg;
import static de.jurihock.voicesmith.dsp.Math.real;

	{
		final int fftSize = frame.length / 2;
		float re, im, abs, nextPhase, phaseDelta;

		for (int i = 1; i < fftSize; i++)
		{
			// Get source Re and Im parts
			re = frame[2 * i];
			im = frame[2 * i + 1];
			abs = abs(re, im);

			// Invert phase value
			nextPhase = arg(re, im);

			// Compute phase delta
			phaseDelta = princarg(nextPhase - 2F * prevPhase1[i] + prevPhase2[i]);
			
			// Disable some frequency components
			if(Math.abs(phaseDelta) > 0.05F * omega[i])
			{
				abs = 0;
				nextPhase = 0;
			}
			
			// Save phase values
			prevPhase2[i] = prevPhase1[i];
			prevPhase1[i] = nextPhase;

			// Compute destination Re and Im parts
			frame[2 * i] = real(abs, nextPhase);
			frame[2 * i + 1] = imag(abs, nextPhase);