ENH: Allow custom frequencies. Closes #4541.