Frequency estimation through fitting