public String getNoteForFrequency(double freq) {

		int octave = getOctave(freq);           

		//System.out.println(octave);
		int workingOctave = 1;
		if (octave != 0) {
			workingOctave = octave < 0? (-octave*2) : (octave*2);
		}

		double workingSaFrequency = octave<0? (defaultSaFrequency/workingOctave) : (workingOctave * defaultSaFrequency);      
		double _ratio = freq / workingSaFrequency;

		/*System.out.println("Octave: " + octave);
              System.out.println(sargamForThisOctave(octave));*/

		for(int i=0;i<hNotes.length;i++) {
			double _hiRatio = ratios[i] + (ratios[i] * tolerances[i]);
			double _lowRatio = ratios[i] - (ratios[i] * tolerances[i]);
			if (_lowRatio <= _ratio && _ratio <= _hiRatio ) {
				return getNoteType(hNotes[i],octave);
			} else {
			}
		}
		return null;
	}