def peaksPos(data):
	"""
	Peak Density: calculates the density of peaks within the current locality. 
		A peak is defined as a point higher in amplitude than the two points 
		to its left and right side. 
	
	Parameters
	----------
		data: array-like
			2D matrix of shape (time, data)
		
	Returns
	-------
		peaksPosData: 1D numpy array containing the average number of peaks 
					   in a given signal
	"""

	data1 = data[1:-1]
	data2 = data[0:-2]
	data3 = data[2:]
	data4 = data1 - data2
	data5 = data1 - data3
	peakcount = 0
	
	for i in range(len(data)-2):
		if data4[i] > 0 and data5[i]>0:
			peakcount += 1
	
	peaksPosData = peakcount/(len(data)-2)
	
	return peaksPosData