Terahertz coded-aperture imaging follows the basic principles of optical coded-aperture imaging and microwave coincidence imaging and is a novel imaging technique. Herein, the wave spatial distribution or illumination pattern is usually obtained by a sub-reflector antenna. Terahertz coded-aperture imaging has some significant advantages such as a high frame rate, high resolution, and ability of forward-looking and staring imaging. To achieve simultaneous functions of aperture coding and beam scanning, we designed a terahertz coded-aperture imaging system that utilizes digital sub-reflector antenna and quasi-optical techniques. Based on this system, we deduce and simulate the influencing factors on its resolution. Then, different algorithms are applied to the imaging model in order to verify the superiority of sparse reconstruction for coded-aperture imaging. Finally, we compare the imaging results of our imaging system and that of a traditional real aperture imaging structure for the same simulation parameters. The results prove that our imaging system performs better with high resolution, small volume, and low cost. This new imaging technique can be applied to areas such as battlefield reconnaissance, security checks, anti-terrorism, and terminal guidance.