The original function is only for the case of φ=0, but sweeping the phase of every harmonic looks cool in an animation so...
More about this function: S1631073X19302171.pdf