docs/examples/RegularlySampledData.java
/**
     * Function to create sample sine values.
     *
     * @param duration  duration
     * @param frequency frequency
     * @param stepsize  step size
     * @return generated sine values
     */
Function to create sample sine values.
@param duration  duration
@param frequency frequency
@param stepsize  step size
@return generated sine values
Function to create sample sine values . @param duration duration @param frequency frequency @param stepsize step size @return generated sine values
private static double[] createSineWave(double duration, double frequency,
                                           double stepsize) {
        int size = (int) Math.ceil(duration * 2 * Math.PI / stepsize);
        double[] y = new double[size];
        for (int i = 0; i < size; i++) {
            double x = i * stepsize;
            y[i] = Math.sin(frequency * x);
        }
        return y;
    }
private static double [ ] createSineWave ( double duration , double frequency , double stepsize ) { int size = ( int ) Math . ceil ( duration * 2 * Math . PI / stepsize ) ; double [ ] y = new double [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { double x = i * stepsize ; y [ i ] = Math . sin ( frequency * x ) ; } return y ; }
Function to create sample sine values.
Function to create sample sine values .
// sine