Overview
The clock rate of an incoming T-carrier signal is extracted from its bipolar line code. Each signal transition provides an opportunity for the receiver to see the transmitter's clock. The AMI code guarantees that transitions are always present before and after each mark (1 bit), but are missing between adjacent spaces (0 bits). To prevent loss of synchronization when a long string of zeros is present in the payload, deliberate bipolar violations are inserted into the line code, to create a sufficient number of transitions to maintain synchronization; this is a form of run length limited coding. The receive terminal equipment recognizes the bipolar violations and removes from the user data the marks attributable to the bipolar violations.
T-carrier was originally developed for voice applications. When voice signals are digitized for transmission via T-carrier, the data stream always includes ample 1 bits to maintain synchronization. (To help this, the μ-law algorithm for digitizing voice signals encodes silence as a continuous stream of 1 bits.) However, when used for the transmission of digital data, the conventional AMI line code may fail to have sufficient marks to permit recovery of the incoming clock, and synchronization is lost. This happens when there are too many consecutive zeros in the user data being transported.
The exact pattern of bipolar violations that is transmitted in any given case depends on the line rate (i.e., the level of the line code in the T-carrier hierarchy) and the polarity of the last valid mark in the user data prior to the unacceptably long string of zeros. It would not be useful to have a violation immediately following a mark, as that would not produce a transition. For this reason, all modified AMI codes include a space (0 bit) before each violation mark.
In the descriptions below, "B" denotes a balancing mark with the opposite polarity to that of the preceding mark, while "V" denotes a bipolar violation mark, which has the same polarity as the preceding mark. In order to preserve AMI coding's desirable absence of DC bias, the number of positive marks must equal the number of negative marks. This happens automatically for balancing (B) marks, but the line code must ensure that positive and negative violation marks balance each other.
Read more about this topic: Modified AMI Code