Design of high-energy THz sources based on optical rectification