The present paper proposes a method for automating the analysis of F0 contours using the Fujisaki-model on ToBI-labeled speech data. ToBI-labels are used to preselect the number of necessary phrase and accent commands and align the onsets and o sets ofthese commands with the segments of the utterance. Local optimization is then performed with special regard to `reliable' portions of the F0 contour, for instance, the syllable nuclei. Analysis results are used for formulating quantitative F0 control rules for speech synthesis.