This article builds upon the introductory article about baseband modulation where Manchester code was explained, and hopefully understood and accepted by the reader as a viable code.
One problem with the "vanilla" Manchester code, and for instance with many other codes, is that an inversion of polarity (that inverts all chirps) will lead to RX detecting an inverted message.
This happens easier than you might think: cables are built with inverted wires, users connect the plug the wrong way, and some filters that eliminate DC bias invert the signal by design.
A simple and clever solution is to decode the message based on changes or differences of signal. No change is 0, change is 1. Level changes are reliably detected regardless of polarity.
In order to RX rely on changes, the TX must send a modified bit stream. The simplest way to do it is to integrate, that is, keep summing the message bits (and making 1+1=0). By integrating at one side and differentiating at the other side, we end up with the original message.
... any line code (e.g. Manchester) takes place here...
Note that, in the received message, we lose the very first bit, because we did not have a previous bit to differentiate. This is another reason why the preamble is so important: errors like this fall over the preamble, not over the message.
Differential encoding can be understood as a very simple form of convolutional coding since each transmitted symbol depends on a number of previous symbols (in this case, just two).