period formula with frequency