We demonstrate the use of optical pulse-shaping technique in conjunction with difference frequency generation in a non-linear optoelectronic crystal for generating synthesized waveforms at terahertz frequencies. Spectral phase modulations, programmed using Gerchberg-Saxton algorithm and prepared in a spatial light Fourier filter, produce tailored terahertz pulses, including chirped pulses, zero-area pulses, and trains of multiple pulses for tunable narrow-band terahertz radiation up to 2.0 THz. (C) 2003 Optical Society of America.