Java Gauss gaussianWindow(double mean1, double mean2, double std)

Here you can find the source of gaussianWindow(double mean1, double mean2, double std)

Description

Evaluate a Gaussian window function with the given mean range and standard deviation.

License

Open Source License

Parameter

Parameter Description
mean1 The low end of the mean range.
mean2 The high end of the mean range.
std The standard deviation.

Return

The value of the Gaussian window function.

Declaration

public static double gaussianWindow(double mean1, double mean2, double std) 

Method Source Code

//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);
    }
}

Related

  1. gaussianDerivative(double x)
  2. gaussianFilter(float[] weights, float sigma)
  3. gaussianIntegral(double x)
  4. gaussianPDF(double mean, double variance, double x)
  5. gaussianPDF(double mu, double sigma, double x)
  6. gaussJordanElimination(boolean[][] matrix)
  7. gaussTable(final int steps)