Optimum filters for detector charge measurements in presence of 1/f noise