function oct = helpfindoctave(f, o) %%%% Function checks to see if f is in the acceptable range. If it is, then %%%% function returns the octave count, "o". If it is not, the function determines whether %%%% pitch is too high or too low, adds the appropriate number to the octave count, %%%% "o", and recurs on itself until the frequency, "f", is in the proper range. if f >= 254.284 & f <= 508.5675 oct = o; elseif f < 254.284 oct = helpfindoctave(2*f, o-1); elseif f > 508.5675 oct = helpfindoctave(f/2, o+1); end