Arbitrarily shaped picosecond pulses by spectral compression of femtosecond pulses in engineered quadratic media