How are Mode 2 pulses encoded? I'm working on a research project looking at Mode 3A/C replies and have noticed some pulse patterns that look very similar which I suspect are Mode 2 replies.  They appear to differ by just one pulse.

I'd like to extend my decoder to decode these as well but I'm struggling to find out how Mode 2 pulses are encoded.  I know that mode 3A/C is encoded using the Gilham code but that excludes the extra pulse that I am seeing.

Is there a publically available document which explains how Mode 2 pulses are encoded ?  I've search high and low and haven't found one yet.
I think the problem is that you see a Mode 3/A (identity) reply, but you try to interpret it as Mode C (altitude reply). 

In Mode C, altitude is Gillham encoded, using all pulses except for D1 and X. This gives a range of -1200 to 126700 ft in 100 ft increments. 
If you see a D1 pulse, you are not looking at a Mode C reply. 

In Mode A, a 12 bit identity (squawk code) is transmitted, using all pulses except for X. In Mode A, the D1 pulse is commonly used (in fact, evey squawk code where the last digit is odd uses the D1 pulse).  It is simply the octal conversion of bits / pulses [A4 A2 A1], [B4 B2 B1], [C4 C2 C1], [D4, D2 D1].

For example, if you would encode squawk code 2345 you would set pulses [A2 = 2], [B1 &amp; B2 = 3], [C4 = 4] and [D4 &amp; D1 = 5]. 

Note that in case of Mode A, there may be an addition pulse for radar IDENTificaton. This is the Special Purpose Identification (SPI) pulse and it occurs 4.35 microseconds after the start of the closing framing pulse, with a duration of 0.45 microseconds.



source: www.radartutorials.eu