Now using armadillo, need to find derivatives and peaks