Frequency modulation, or FM, is an analog modulation scheme that encodes information by changing the frequency of a carrier wave.

FM is commonly used in

  • FM Radio stations to transmit music and speech
  • Pager standards such as POCSAG
  • Weather satellites sending pictures using Automatic Picture Transmission (APT)
  • Handheld radio transceivers using Narrow FM (NFM)

Implementation in Python

import math
RATE = 32_000

# Phase accumulator
ph = 0

for s in samples:
    ph += 2 * math.pi * s / RATE

    i = math.sin(ph)
    q = math.cos(ph)

    write(i, q)