Calculating harmonic frequencies