// 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 cos(float angle);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float sqrt(float value);


import static de.jurihock.voicesmith.dsp.Math.PI;
import static de.jurihock.voicesmith.dsp.Math.cos;
import static de.jurihock.voicesmith.dsp.Math.sqrt;
	 *            routine.
	 * */
	public Window(int frameSize, int hopSize, boolean isPeriodic, boolean isWeighted)
	{
		this.frameSize = frameSize;
		this.hopSize = hopSize;
		this.isPeriodic = isPeriodic;
		this.isWeighted = isWeighted;
	}

	private void weight(float[] window)
	{
		float weighting = 0;

		for (int n = 0; n < frameSize; n++)
			weighting += window[n] * window[n];

		weighting = 1F / sqrt(weighting / hopSize);

		for (int n = 0; n < frameSize; n++)
			window[n] *= weighting;
	}

	public float[] hann()
	{
		final float[] window = new float[frameSize];
		final int N = (isPeriodic) ? frameSize + 1 : frameSize;

		for (int n = 0; n < frameSize; n++)
		{
// 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 cos(float angle);
// 
// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Math.java
// public static native float sqrt(float value);


// Path: voicesmith/src/de/jurihock/voicesmith/dsp/Window.java
import static de.jurihock.voicesmith.dsp.Math.PI;
import static de.jurihock.voicesmith.dsp.Math.cos;
import static de.jurihock.voicesmith.dsp.Math.sqrt;

	 *            routine.
	 * */
	public Window(int frameSize, int hopSize, boolean isPeriodic, boolean isWeighted)
	{
		this.frameSize = frameSize;
		this.hopSize = hopSize;
		this.isPeriodic = isPeriodic;
		this.isWeighted = isWeighted;
	}

	private void weight(float[] window)
	{
		float weighting = 0;

		for (int n = 0; n < frameSize; n++)
			weighting += window[n] * window[n];

		weighting = 1F / sqrt(weighting / hopSize);

		for (int n = 0; n < frameSize; n++)
			window[n] *= weighting;
	}

	public float[] hann()
	{
		final float[] window = new float[frameSize];
		final int N = (isPeriodic) ? frameSize + 1 : frameSize;

		for (int n = 0; n < frameSize; n++)
		{
			window[n] = 0.5F * (1F - cos(2F * PI * n / (N - 1F)));