Discrete Fourier Transform by Hand

Aug 14, 2026 11:52 PM - 2 hours ago 1

In awesome processing, the Discrete Fourier Transform (DFT) is nary uncertainty the astir important method. But the mathematics progressive is highly complex, literally, involving a summation complete a analyzable number word e^(-iwt), wherever e is the Euler number, one is the imaginary unit, w is the angular frequency, and t is time.

I developed this workout to show that underneath specified complexity, DFT is conscionable a bid of matrix multiplications you tin cipher by hand. ✍️ Once you spot that, it should not astonishment you that a heavy neural network, which is besides a bid of matrix multiplications, pinch activation functions in-between, tin study to execute DFT to process and analyse signals truthful effectively.

💡 Learned vs. Fixed: U-Net learns its filters from information to process a awesome successful the spatial domain. The DFT is the classical opposite, a fixed transform, designed by manus alternatively than learned, that views the aforesaid awesome successful the wave domain arsenic a operation of cosine waves.

How does DFT work?

  • Signals A, B, and C successful the 🟧 wave domain:

  • A = cos(w) + 2cos(2w)

  • B = cos(w) + cos(3w) + cos(4w)

  • C = -cos(2w) + cos(3w)

  • Each awesome is simply a weighed sum of 4 cosine waves astatine frequencies 1w, 2w, 3w, and 4w.

  • We will use Inverse DFT to person the signals to clip domain representations, and past show DFT tin person backmost to their original wave domain representations.

  • Signal X successful the 🟩 clip domain. X is sampled astatine 10 clip points 1t, 2t, …, 10t:

  • X = [-2.5, -1.8, 3, -0.7, -1.0, -0.7, 3, -1.8, -2.5, 5]

  • Suppose X is besides a weighted sum of the aforesaid 4 cosine waves, but we don’t already cognize their weights. We will use DFT to observe them.

  • Write the coefficients of A, B, C arsenic a matrix F. Each awesome is simply a row. Each wave is simply a column.

  • A → [1, 2, 0, 0]

  • B → [1, 0, 1, 1]

  • C → [0, -1, 1, 0]

  • Sample from the continuous cosine waves astatine discrete clip points 1t, 2t, 3t, to 10t.

More