AGCD: a robust periodicity analysis method based on approximate greatest common divisor