FM or frequency modulation is an old method of encoding data on magnetic media such as floppy disks or hard disks. We can conceive of magnetic media as consisting of very long lines of magnetic dipoles (tiny bar magnets) which can point in either of two directions, N-S or S-N. The simplest encoding would be to represent a 0 by N-S and a 1 by S-N, but there are three reasons why this doesn't work.

  • Detecting changes in the direction of the magnetic field (flux variations) is easier than detecting its absolute direction, as there is a spike of electrical current when the drive heads pass over a flux variation.
  • A long sequence of zeroes all coded as N-S would make it difficult to determine where one bit ends and the next begins.
  • A long sequence of zeroes all coded as N-S would create a very large magnetic field.

FM encoding works by having a flux variation at the start of every bit as a clock tick or synchronisation marker. There is also a flux variation in the middle of bits which are 1 but not in the middle of bits which are 0.

FM encoding is not very efficient, because it uses an average of 1.5 flux variations per bit, of which 1 is just for the clock and only 0.5 for data. This is important because the hardware limits the number of flux variations allowed per inch, and the fewer flux variations we need per bit, the more data we can fit into the same space. Modified frequency modulation or MFM is an improved version of FM which is still used for floppy disks today.