The harmonic balance method has emerged as an efficient and accurate approach for computing periodic, as well as almost periodic, solutions to nonlinear ordinary differential equations. The accuracy of the harmonic balance method can however be negatively impacted by aliasing. Aliasing occurs because Fourier coefficients of nonlinear terms in the governing equations are approximated by a discrete Fourier transform (DFT). Understanding how aliasing occurs when the DFT is applied is therefore essential in improving the accuracy of the harmonic balance method. In this work, a new operator that describe the fold-back, i.e. aliasing, of unresolved frequencies onto the resolved ones is developed. The norm of this operator is then used as a metric for investigating how the time sampling should be performed to minimize aliasing. It is found that a time sampling which minimizes the condition number of the DFT matrix is the best choice in this regard, both for single and multiple frequency problems. These findings are also verified for the Duffing oscillator. Finally, a strategy for oversampling multiple frequency harmonic balance computations is developed and tested.