Back to project page audiopulse-androidclient.
The source code is released under:
GNU General Public License
If you think the Android project audiopulse-androidclient listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* =========================================================== * SanaAudioPulse : a free platform for teleaudiology. * /*w w w. java2s . c o m*/ * =========================================================== * * (C) Copyright 2012, by Sana AudioPulse * * Project Info: * SanaAudioPulse: http://code.google.com/p/audiopulse/ * Sana: http://sana.mit.edu/ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * [Android is a trademark of Google Inc.] * * ----------------- * SpectralWindows.java * ----------------- * (C) Copyright 2012, by SanaAudioPulse * * Original Author: Ikaro Silva * Contributor(s): -; * * Changes * ------- * Check: http://code.google.com/p/audiopulse/source/list */ package org.audiopulse.analysis; //Noinstantiable utility class public class SpectralWindows { private SpectralWindows(){ //Suppress default constructor for noninstantiability throw new AssertionError(); } public static double hamming(int n, int N){ // assert that the absolute value is >= 0 assert ( n <= N ) : "Window sample: " + n + " is beyond expected window range: "+ N; double out=0.54 - 0.46*Math.cos(2*Math.PI*(double)n/(N-1)); return out; } }