DCC Bus Signals

thumb|DCC Waveform
NMRA standard S-9.1 describes the DCC signal as:
"The NMRA baseline digital command control signal consists of a stream of transitions between two equal voltage levels that have opposite polarity."
The waveform on the right illustrates what the DCC track voltage would look like on an oscilloscope when measured with the probe on one rail, and probe/scope ground reference connected on the other rail. The dashed center-line represents 0V. The waveform alternates between a positive and negative voltage, as the 0V reference floats from one rail to the other.The suggestion of an AC signal implies that one rail is always energized while the other serves as the "neutral" or 0V reference. 
Each data bit is represented by period between two pulses. The 100 µSec pulse represents a 0 (period = 200µS) and the narrow 58 µSec pulse represents 1. In this diagram, the positive pulse comes first.
===Extracting the DCC Signal===
A device such as an optocoupler on a multifunction decoder is connected across the rails. It detects the presence, or lack of a voltage on the rail, presenting a logic level signal to the input of the processor.Current can only flow in one direction, turning the LED on when the LED is biased correctly. The microcontroller measures the period between pulses to extract the data. Regardless of which rail it receives pulses from, the optocoupler will be able to extract the pulses. This allows the decoder to receive data regardless of the orientation of the locomotive on the track. The optocoupler serves two purposes: It isolates the microcontroller from the track voltage, and generates the necessary voltages required by the microcontroller's input.
Sophisticated multifunction decoders can measure the difference in potential between the two rails for Asymmetric DCC purposes.
===Generating a DCC Signal===
The command station generates a digital signal at logic level voltages (0, ~5V), which serves as an input to one or more boosters. The boosters amplify the command station's output to the desired track voltage using a pair of CMOS Inverters. These are often incorporated into a single package, called an H–Bridge. The outputs of the H-Bridge will follow the input, with one rail being held to 0V and the other having voltage applied.
An H-bridge is often used to control a DC motor. Two of the four transistors are switched on at one time, determining which output terminal has the power supply voltage applied, thus controlling the speed and the direction of the motor. A PWM signal controls the duration the transistors are turned on, determining the speed of the motor. A 40% duty cycle represent an average of 40% of the supply voltage.
An H-bridge is suitable for generating the DCC signal on the rails. The command station's signal determines their state.
Logic
Level	State	Rail-A	Rail-B	PotentialAB
0	Low 	0V 	15V 	15V
1	High 	15V 	0V 	15V
This is illustrated in the oscilloscope traces. The yellow and cyan traces are measured with a probe on each rail with the ground connected to the ground of the booster. The yellow "1" and cyan "2" on the left side indicates the ground reference of each trace, where the probe voltage is equal to the ground. Both traces alternate between 0 and 15V and are the inverse of the other.
As the traces show, when Rail A (yellow trace) has voltage applied to it, the cyan trace representing Rail B is at 0V.
The top magenta trace is generated internally by mathematically summing the two voltages. It shows a potential of 30Vpk–pk (15 + 15), but does not indicate a 0V crossing at the midpoint. This representation is the source of many misconceptions regarding the voltages found on the track. 
Proof is found by measuring across a gap in the rails, such as that of a power district or reverse loop. If the potential is 0V, both sides of the gap are at the same potential. If the potential equals that of the track voltage, the rails are not in phase. The potential across the gap cannot exceed the track voltage. Should a metal wheel bridge that gap, a short occurs.
The voltage across the rails will be less than that of the power supply, due to the booster's internal losses. See Measuring Track Voltage for additional information. 
=== Signals on the DCC Power Bus ===
Oscilloscopes display signals as vectors, as they have both amplitude and direction. With the probes for each channel are connected to the Rail outputs.Since the booster output is floating, there is no need for use of a "differential probe" as is often claimed. , the zero reference is supplied through the Ground or Common terminal of the booster.
The Magenta trace is twice the amplitude, which is the sum of Channels 1 & 2. This trace represents a Differential Signal with no GroundThe term Ground is incorrect, as ground should only refer to the point where the electrical system is connected to earth ground. The correct definition is floating, as there is no fixed reference to a point on the booster., as per the NMRA Standards.Read the entire document and any notes. The standard is deliberately not specific, as it only describes what the result should look like, not the exact construction. Also note it does not define polarity, as that is a quality wherein the direction the locomotive defines the "positive" rail.Differential Signal: One signal is in the High State while the other is Low, allowing Common Mode Rejection of any noise which may be present.</><ref>Read the entire document and any notes. The standard is deliberately not specific, as it only describes what the result should look like, not the exact construction. Also note it does not define polarity, as that is a quality wherein the direction the locomotive defines the "positive" rail.Differential Signal: One signal is in the High State while the other is Low, allowing Common Mode Rejection of any noise which may be present. The correct terminology in the NMRA Standard should be "floating". The track voltage is “floating”, meaning it has no reference to a common point. The measurement is taken as the voltage difference between the two wires. As the measurement is floating, this gives rise to the myth that the DCC signal has both positive and negative components. 
The digital data is represented by the time (period) the rail is energized. There are no positive and negative voltages on the rails, the rail is either On or Off. The multifunction decoder only sees its input signal go high (On) and low (Off). A total period of 58µS High + 58µs Low (116µS in total) represents a binary value of 1, a total period of 200µs represents a 0 value.The data is represented by the time between the leading edges of the pulses. 
This is not an ACAlternating current is continuously changing in amplitude and direction in time, where the current follows the voltage. signal, as the rail will have a voltage or no voltage present at any point in time. What is happening is the current is changing direction as it moves from one rail to another. Measuring this with an oscilloscope will display a peak-to-peak signal, which many will claim supports their assertion that the signal is an AC waveform. Since this measurement is made with the track outputs floating, the trace indicates which connection was more positive than the other at a point in time. The output of the booster is floating, as there is no fixed reference point such as a chassis ground for zero volts. In this case, the "ground" clip is connected to one of the rails, making this trace possible.
This method of transmitting data and power in the same signal results in a very robust signalling technique with a high signal to noise ratio, while reducing space charges around the rails and the electrostatic attraction of contaminants. A multifunction decoder can receive data regardless of the orientation of the vehicle, as either rail has the On/Off signal available.
</div>