Sweep distortion removal from terahertz images via blind demodulation