Here you can find the source of gaussianWindow(double mean1, double mean2, double std)
Parameter | Description |
---|---|
mean1 | The low end of the mean range. |
mean2 | The high end of the mean range. |
std | The standard deviation. |
public static double gaussianWindow(double mean1, double mean2, double std)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . j av a 2 s . co m*/ * Evaluate a Gaussian window function with the given mean range and standard deviation. The formula is: * <p> * <code>G(m1, m2, s) = e ^ [(-1 / 2) * ([m2 - m1] / s) ^ 2]</code> * * @param mean1 The low end of the mean range. * @param mean2 The high end of the mean range. * @param std The standard deviation. * @return The value of the Gaussian window function. */ public static double gaussianWindow(double mean1, double mean2, double std) { double fraction = (mean2 - mean1) / std; double exponent = -(fraction * fraction) / 2.0; return Math.exp(exponent); } }