private void inputRefinement(){
		
		//raw data from the sound file is analysed to produce pitch data
		PitchDetection analyser = new PitchDetection(preDetect);
		postDetect = analyser.getData();
		pitches = postDetect.getPitchArray();
		
		//loops through the array of mixed null and non pitches, counting the number of non null pitches
		for(int j = 0; j < pitches.length; j++){
			if(pitches[j] != null){
				nonNullPitches++;
			}
		}
		
		System.out.println("Non Null Notes: " + nonNullPitches);
		Note[] nonNullPitchArray = new Note[nonNullPitches+1];
		
		nonNullPitches = 0;
		
		for(int j = 0; j < pitches.length; j++){
			if(pitches[j] != null){
				nonNullPitchArray[nonNullPitches] = pitches[j];
				nonNullPitches++;
			}
		}
		
		System.out.println("Non Null Notes: " + nonNullPitches);
		
		scale = new Scale();
		scale.setScale(nonNullPitchArray);

		arraySize = nonNullPitches/pitchSampleGroup.length;
		arraySize++;
		
		System.out.println("non-Null Pitches: " + nonNullPitches);
		System.out.println("number of pitches: " + pitches.length);
		System.out.println("ArraySize: " + arraySize);
		
		Mode mode = new Mode();
		
		int j = 0;
		int timeRecorder = 0;
		int a = 0; // a is the index for the noteTimer array
		
		noteTimer = new double[arraySize*2];
		postModeNotes = new Note[arraySize*2];
		
		System.out.print("Average Pitch List: ");
		
		for(int i = 0; i < pitches.length; i++){
			
			//if the current array index represents a pitch
			if(pitches[i] != null){
				
				//check to see if no pitches have been set yet, if so add the number of array index spots so far to timeRecorder (1 index spot = 1 sample = 1/22050 seconds)
				if(j == 0){
					timeRecorder = i;
				}
				//add the current pitch to 
				pitchSampleGroup[j] = (float) pitches[i].getFrequency();
				j++;
			}
			
			if(j == pitchSampleGroup.length-1){//if the pitchSampleArray is full
				Pitch pitch = new Pitch();
				System.out.print(pitch.getNote((mode.getMode(pitchSampleGroup))).getPitch() + ", ");
				
				postModeNotes[a] = pitch.getNote((mode.getMode(pitchSampleGroup)));//add the mode of the sample group to the post mode notes array
				
				noteTimer[a] = ((((float) i) - timeRecorder)/AudioData.SAMPLE_RATE);//dividing the number of samples the note occupies, as recorded in timeRecorder by the sample rate gives the time that note was present for
				j = 0;//resetting the mode sample array to zero, ready to be filled with new notes
				a++;
			}
			
		}
		
		System.out.println("");
		postDetect.setAveragePitches(postModeNotes);
		postDetect.setNoteTimes(noteTimer);
		postDetect.setNonNullPitches(nonNullPitchArray);
	}