Theory and measurements of harmonic generation in semiconductor superlattices with applications in the 100 GHz to 1 THz range