Modified Frequency Modulation, commonly MFM, is a run-length limited (RLL) coding scheme used to encode the actual data-bits on most floppy disks. It was first introduced in disk drives with the IBM 3330 hard disk drive in 1970. Floppy disk drive hardware examples include Amiga, most CP/M machines as well as IBM PC compatibles.
MFM is a modification to the original digital FM (digital frequency modulation also known as delay coding) scheme for encoding data on single-density floppy disks and some early hard disk drives. Due to the minimum spacing between flux transitions that is a property of the disk and head design, MFM, which guarantees at most one flux transition per data bit, can be written at higher density than FM, which can require two transitions per data bit. It is used with a data rate of 250–500 kbit/s 500–1000 kbit/s encoded) on industry standard 5¼-inch and 3½-inch ordinary and high density diskettes. MFM was also used in early hard disk designs, before the advent of more efficient types of run-length limited coding. Except for the steadily disappearing 360 KiB/1.2 MiB (5.25-inch) and 720~880 KiB/1.4~1.6 MiB (3.5-inch) floppy disk formats, MFM encoding is obsolete in magnetic recording.
As is standard when discussing hard drive encoding schemes, FM and MFM encodings produce a bit stream which is NRZI encoded when written to disk. A 1-bit represents a magnetic transition, and a 0-bit no transition. Data encoding has to balance two factors:
Both FM and MFM encodings can also be thought of as having data bits separated by clock bits, but with different rules for encoding the bits. Still, both formats encode each data bit as two bits on disk (because of delimiters that are required at the beginning and end of a sequence, the actual density is slightly lower).
The basic encoding rule for FM is that all clock bits are 1: zeros are encoded as 10, ones are encoded as 11. The number of magnetic transitions per bit is on average 1.5 (50%*1 + 50%*2).