A rationale from frequency perspective for grokking in training neural network