public float Compute( float x, float y, float z )
{
float noise = 0;
float amp = Amplitude;
float freq = Frequency;
for ( int i = 0; i < Octaves; i++ ) {
noise += Noise( x * freq, y * freq, z * freq ) * amp;
freq *= 2; // octave is the double of the previous frequency
amp *= Persistence;
}
return noise;
}