A moving-box algorithm to estimate generalized dimensions and the f (a) spectrum