  Constrained codes are used to eliminate error-prone patterns in various
practical systems. Recently, we introduced efficient binary symmetric
lexicographically-ordered constrained (LOCO) codes and asymmetric LOCO (A-LOCO)
codes to increase density in magnetic recording systems and lifetime in Flash
systems by eliminating the relevant detrimental patterns. Due to their
application, LOCO and A-LOCO codes are associated with level-based signaling.
Studying the power spectrum of a random signal with certain properties is
principal for any storage or transmission system. In this paper, we first
modify a framework from the literature in order to introduce a method to derive
the power spectrum of a sequence of constrained data associated with
level-based signaling. We apply our method to infinitely long sequences
satisfying symmetric and asymmetric constraints. Next, we show how to
generalize the method such that it works for a stream of finite-length
codewords. We use the generalized method to devise closed forms for the spectra
of finite-length LOCO and A-LOCO codes from their transition diagrams. Our LOCO
and A-LOCO spectral derivations can be performed for any code length and can be
extended to other constrained codes. We plot these power spectra, and discuss
various important spectral properties for both LOCO and A-LOCO codes.
