Skip to content
UPEEC

Fourier Transform

Convert a signal from the time domain to the frequency domain — its spectrum.

Intermediate
Comments 0

X(f)=∫−∞∞x(t) e−j2πft dtx(t)=∫−∞∞X(f) ej2πft dfX(f) = \int_{-\infty}^{\infty} x(t)\, e^{-j2\pi f t}\, dt \qquad x(t) = \int_{-\infty}^{\infty} X(f)\, e^{j2\pi f t}\, df

Useful properties: linearity, time shift (adds phase), time scaling (shorter in time = wider in frequency), and convolution ↔ multiplication.

For sampled data computers use the DFT, computed efficiently by the FFT in O(Nlog⁡N)O(N \log N). The frequency resolution is Δf=fs/N\Delta f = f_s / N. Apply a window (Hann, Hamming) to reduce spectral leakage.

import numpy as np
X = np.fft.rfft(x * np.hanning(len(x)))
freqs = np.fft.rfftfreq(len(x), d=1/fs)

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.