The secret to the perfect cup of coffee is not using expensive or rare varieties, but in perfecting the art of bean grinding, a study has found.