public static function getFundamental($fz, $max = 30, $fuzz = 0) {
		if (!is_array($fz)) {
			$fz = array($fz);
		}
		sort($fz);

		for ($i = 1; $i < $max; $i++) {
			$F = $fz[0] / $i;
			for ($j = 1; $j < count($fz); $j++) {
				$partial = $fz[$j] / $F;
				if (abs($partial - round($partial)) > $partial * $fuzz) {
					continue 2;
				}
			}
			return $F;
		}
		return null;
	}
public static function getFundamental($fz, $max = 30, $fuzz = 0) {
		if (!is_array($fz)) {
			$fz = array($fz);
		}
		sort($fz);

		for ($i = 1; $i < $max; $i++) {
			$F = $fz[0] / $i;
			for ($j = 1; $j < count($fz); $j++) {
				$partial = $fz[$j] / $F;
				if (abs($partial - round($partial)) > $partial * $fuzz) {
					continue 2;
				}
			}
			return $F;
		}
		return null;
	}
public static function getFundamental ( $ fz , $ max = 30 , $ fuzz = 0 ) { if ( ! is_array ( $ fz ) ) { $ fz = array ( $ fz ) ; } sort ( $ fz ) ; for ( $ i = 1 ; $ i < $ max ; $ i ++ ) { $ F = $ fz [ 0 ] / $ i ; for ( $ j = 1 ; $ j < count ( $ fz ) ; $ j ++ ) { $ partial = $ fz [ $ j ] / $ F ; if ( abs ( $ partial - round ( $ partial ) ) > $ partial * $ fuzz ) { continue 2 ; } } return $ F ; } return null ; }
returns a harmonic divisor for a group of frequencies which might be perceived
as a ghost fundamental
returns a harmonic divisor for a group of frequencies which might be perceived as a ghost fundamental