I’ve had seven hundred spam comments in a week. If you got swept up in the purge, please do try again.
For my own future reference, in case I lose the bit of paper on which I jotted it.
In a function of period 2π, a unit step discontinuity in the nth derivative at phase α contributes this to the Fourier series:
i (in e-ik(t-α) – i-n eik(t-α)) / (2πkn+1)
I haven’t the skill to prove this for general n, but then I’m unlikely to need it for n>2.