A method of line coding for optical transmission comprising: encoding digital data to a set of five line symbols; where the line symbols have amplitude values of 0, ± A1, ± A2, where |A2| > |A1|, where: a first binary value maps to the line symbols having amplitude values of 0 and ± A2; a second binary value maps to the line symbols having amplitude values of ± A1; where the encoding comprises using a state machine with four states arranged in a sequence, wherein: digital data with the first binary value causes the state machine to remain in the same state, where: in a state 1, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude -A2; in a state 2, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude 0; in a state 3, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude +A2; in a state 4, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude 0; digital data with the second binary value causes the state machine to move to the next state, where: in the state 1, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude -A1; in the state 2, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude +A1; in the state 3, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude +A1; in the state 4, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude -A1, wherein the next state for state 4 being state 1. a first binary value maps to the line symbols having amplitude values of 0 and ± A2; a second binary value maps to the line symbols having amplitude values of ± A1; digital data with the first binary value causes the state machine to remain in the same state, where: in a state 1, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude -A2; in a state 2, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude 0; in a state 3, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude +A2; in a state 4, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude 0; in a state 1, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude -A2; in a state 2, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude 0; in a state 3, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude +A2; in a state 4, digital data with the first binary value causes the state machine to map the digital data to a line symbol with amplitude 0; digital data with the second binary value causes the state machine to move to the next state, where: in the state 1, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude -A1; in the state 2, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude +A1; in the state 3, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude +A1; in the state 4, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude -A1, in the state 1, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude -A1; in the state 2, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude +A1; in the state 3, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude +A1; in the state 4, digital data with the second binary value causes the state machine to map the digital data to a line symbol with amplitude -A1, wherein the next state for state 4 being state 1.