Spectral Shaping in Ultra-Dense WDM Systems: Optical vs. Electrical Approaches