Functional data analysis in a mixed model framework