Duality and Symmetry
The forward and inverse Fourier transforms differ only by the sign in the exponent. That near-symmetry, duality, means every transform pair gives a second one for free. Symmetry of the signal (real, even, odd) also forces symmetry of the spectrum, which halves the work and explains why real signals have mirror-image spectra.
Duality
If , then
Transforming twice reverses time: , so four transforms give back . Example: since , also . The sinc function is perfectly band-limited: its spectrum is exactly zero above . That is the heart of the sampling theorem.
import numpy as np
dt = 0.002
t = np.arange(-2000, 2000, dt) # sinc decays slowly, so integrate far out
f = np.sinc(t)
for s in (0.0, 0.25, 0.45, 0.55, 0.8):
F = np.sum(f * np.exp(-2j * np.pi * s * t)) * dt
print(f"s={s:4}: transform of sinc = {F.real:+.4f} rect(s) = {float(abs(s) < 0.5):.0f}")s= 0.0: transform of sinc = +0.9999 rect(s) = 1
s=0.25: transform of sinc = +0.9999 rect(s) = 1
s=0.45: transform of sinc = +0.9995 rect(s) = 1
s=0.55: transform of sinc = +0.0005 rect(s) = 0
s= 0.8: transform of sinc = +0.0001 rect(s) = 0
The transform is 1 inside and 0 outside, up to small ripples from truncating the slowly decaying sinc.
Symmetry rules
| Signal | Spectrum |
|---|---|
| real | Hermitian: (even magnitude, odd phase) |
| real and even | real and even |
| real and odd | purely imaginary and odd |
| even | even |
The first row is why one-sided spectra are enough for real signals and why NumPy has rfft.
import numpy as np
dt = 0.001
t = np.arange(-15, 15, dt)
ft = lambda f, s: np.sum(f * np.exp(-2j * np.pi * s * t)) * dt
signals = {
"real (one-sided exp)": np.where(t >= 0, np.exp(-np.clip(t, 0, None)), 0.0),
"real, even (Gaussian)": np.exp(-np.pi * t ** 2),
"real, odd (t*Gaussian)": t * np.exp(-np.pi * t ** 2),
}
for name, f in signals.items():
Fp, Fm = ft(f, 0.4), ft(f, -0.4)
print(f"{name:23s} F(0.4) = {Fp.real:+.4f}{Fp.imag:+.4f}i F(-0.4) = {Fm.real:+.4f}{Fm.imag:+.4f}i")real (one-sided exp) F(0.4) = +0.1362-0.3435i F(-0.4) = +0.1362+0.3435i
real, even (Gaussian) F(0.4) = +0.6049-0.0000i F(-0.4) = +0.6049+0.0000i
real, odd (t*Gaussian) F(0.4) = -0.0000-0.2420i F(-0.4) = -0.0000+0.2420i
For the real signal is the conjugate of ; the even one has a real spectrum; the odd one a purely imaginary, odd spectrum.
In software
np.fft.rfftreturns only the nonnegative frequencies of a real signal because the rest is redundant; it is about twice as fast asfftand uses half the memory.- Duality is used in radar and communications: a pulse shaped like a sinc occupies a sharply limited band, while a rectangular pulse spreads its energy widely.
Exercises
Exercise 1: Transform twice
What do you get if you apply the Fourier transform four times to ?
Answer
itself.
Solution
Two transforms give ; two more reverse time again, giving . The Fourier transform is a "rotation by 90 degrees" in the time-frequency plane, the idea behind the fractional Fourier transform.
Exercise 2: Use duality
Given , find the transform of .
Answer
.
Solution
By duality, . Write , a scaling by , which gives .
Exercise 3: Check Exercise 2 (code)
Verify the transform of numerically at .
Answer
About 3.1416, 1.6760 and 0.4770 ().
Solution
import numpy as np
dt = 0.002
t = np.arange(-3000, 3000, dt)
f = 1 / (1 + t ** 2)
for s in (0, 0.1, 0.3):
F = np.sum(f * np.cos(2 * np.pi * s * t)) * dt # f is even, so the sine part vanishes
print(s, round(F, 4), round(np.pi * np.exp(-2 * np.pi * s), 4))0 3.1409 3.1416
0.1 1.676 1.676
0.3 0.477 0.477
At the numeric value is 3.1409 instead of because the integral was cut off at , and the tails of beyond that hold about .
Test yourself
A real signal has a spectrum with…
- always
- zero imaginary part always
- no negative frequencies
By duality, the transform of is…
- a Gaussian
- a delta
Why does NumPy's rfft return only about half the frequencies?
- the other half is zero
- the negative frequencies are the conjugates of the positive ones for real input
- it uses a lower resolution
- it drops high frequencies