def emd_function_value(pixel_group, base):
	"""Calculate and return the f value of the given pixel group

	f value is defined as a weighted sum of the pixel values
	modulo a chosen base"""

	f_value = 0
	for i in range(len(pixel_group)):
		f_value = (f_value + pixel_group[i] * (i + 1)) % base
	return f_value