An apparatus and method are disclosed for decoding servo data recorded on
a magnetic disk drive and detecting pinned layer reversals and signal
errors, for example, errors due to noise. The servo data is encoded using
wide-bi-phase encoding. This encoding is detected by a magneto-resistive
sensor that senses the magnetization in domains passing by the sensor.
The decoder includes an A/D converter for sampling the signals emitted by
the sensor, to provide a sequence of the encoded data. A trellis, such as
a Viterbi trellis, is employed to decode the samples generated by the
converter. The trellis includes nodes representing states, connected by
paths representing transitions, among the nodes. A quality value is
generated for the transitions, the quality value representing the
distance between each sample in the sequence output by the A/D converter
and a corresponding expected sample. By applying servo data to two
trellises, each corresponding to a different pinned layer magnetic
orientation, and comparing the quality values produced, the correct
pinned layer orientation may be selected.