Terahertz pulse shaping via optical rectification in poled lithium niobate