extract_trends function

Extract trends from time series objects