# include # include # include # include "cnoise.h" /* * This is example code for how to call functions from the cnoise library. * We generate M realizations of size N of noise * With std = 1 and M >= 10000, for cnoise_generate_colored_noise(...) you should get * expected value for the mean to be close to zero and the standard deviation should * vary linearly in alpha with 1 for alpha = 0 and 0.575 for alpha = 2. * Note that the values are approximate. * */ double mean ( double *x, int N ){ int i; double mean = 0.0; for( i=0; i