All Downloads are FREE. Search and download functionalities are using the official Maven repository.

be.tarsos.dsp.util.fft.ScaledHammingWindow Maven / Gradle / Ivy

There is a newer version: 2.4-1
Show newest version
/*
*      _______                       _____   _____ _____  
*     |__   __|                     |  __ \ / ____|  __ \ 
*        | | __ _ _ __ ___  ___  ___| |  | | (___ | |__) |
*        | |/ _` | '__/ __|/ _ \/ __| |  | |\___ \|  ___/ 
*        | | (_| | |  \__ \ (_) \__ \ |__| |____) | |     
*        |_|\__,_|_|  |___/\___/|___/_____/|_____/|_|     
*                                                         
* -------------------------------------------------------------
*
* TarsosDSP is developed by Joren Six at IPEM, University Ghent
*  
* -------------------------------------------------------------
*
*  Info: http://0110.be/tag/TarsosDSP
*  Github: https://github.com/JorenSix/TarsosDSP
*  Releases: http://0110.be/releases/TarsosDSP/
*  
*  TarsosDSP includes modified source code by various authors,
*  for credits and info, see README.
* 
*/

package be.tarsos.dsp.util.fft;

public class ScaledHammingWindow extends WindowFunction {

	@Override
	protected float value(int length, int index) {
		double scale = 1.0 / (double)length / 0.54;
		double factor = TWO_PI / (double)length;
		return (float) (scale * (25.0/46.0 - 21.0/46.0 * Math.cos(factor * index)));
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy