This paper deals with spectral shaping problem in impulse radio ultra-wideband systems based on coded auxiliary independent signaling (AIS), as a modified version of transmitted-reference approach. In this manuscript, the main contribution includes a unified theoretical framework for spectral analysis which is, not only able to address all effective parameters in the emergence of spectral lines and coexistence issues, but also provides a convex optimization based method. This can produce AIS-aided signals using random process characteristics as optimization variables. In particular, the specific novelty insights of this paper are as follows: (i) to propose a new signal model, where each transmitted symbol is represented by a preamble AIS pulse followed by a set of transmitted data pulses that are synthesized in accordance with a codeword design and within this context, the preamble signal is designed to eliminate spectral lines via an adaptive monitoring of data-stream statistics as the optimal policy; (ii) to exploit the proposed spectral optimization strategies to maximize spectral flexibility.