Coding for spectral shaping