Shift, Scaling and Modulation
You rarely compute a Fourier transform from the integral. Instead you start from a few known pairs and apply rules: what happens to the spectrum when the signal is delayed, sped up, multiplied by a carrier or differentiated. These rules are the working toolkit of signal processing.
The rules
| Operation on | Effect on |
|---|---|
| linearity: | |
| delay: | (phase changes, magnitude does not) |
| scaling: , | |
| modulation: | |
| modulation: | |
| derivative: |
Each follows from a substitution in the integral. For the delay: .
Checking the rules numerically
import numpy as np
dt = 0.001
t = np.arange(-20, 20, dt)
g = lambda t: np.exp(-np.pi * t ** 2) # Gaussian, transform exp(-pi s^2)
G = lambda s: np.exp(-np.pi * s ** 2)
ft = lambda f, s: np.sum(f * np.exp(-2j * np.pi * s * t)) * dt
s = 0.7
checks = {
"delay by 1.5": (ft(g(t - 1.5), s), np.exp(-2j * np.pi * s * 1.5) * G(s)),
"scale f(3t)": (ft(g(3 * t), s), G(s / 3) / 3),
"modulate by cos 2": (ft(np.cos(2 * np.pi * 2 * t) * g(t), s), (G(s - 2) + G(s + 2)) / 2),
"derivative": (ft(np.gradient(g(t), dt), s), 2j * np.pi * s * G(s)),
}
for name, (num, rule) in checks.items():
print(f"{name:18s} numeric {num.real:+.5f}{num.imag:+.5f}i rule {rule.real:+.5f}{rule.imag:+.5f}i")delay by 1.5 numeric +0.20401-0.06629i rule +0.20401-0.06629i
scale f(3t) numeric +0.28093+0.00000i rule +0.28093+0.00000i
modulate by cos 2 numeric +0.00247-0.00000i rule +0.00247+0.00000i
derivative numeric -0.00000+0.94348i rule +0.00000+0.94348i
The reciprocal spreading
Scaling is the most important rule: compressing a signal in time by a factor stretches its spectrum by and lowers it by . Short events need wide bandwidth. A 1 microsecond pulse has a spectrum about 1 MHz wide; that is why fast data links need high bandwidth.
import numpy as np
dt = 1e-4
t = np.arange(-1, 1, dt)
for width in (1.0, 0.1, 0.01):
f = (np.abs(t) < width / 2).astype(float)
s = np.linspace(0, 400, 4001)
F = np.abs(np.array([np.sum(f * np.exp(-2j * np.pi * si * t)) * dt for si in s[::10]]))
first_zero = s[::10][np.argmax(F < 1e-3 * F[0])]
print(f"pulse width {width:5.2f} s: spectrum height {F[0]:.3f}, first zero near {first_zero:.0f} Hz")pulse width 1.00 s: spectrum height 1.000, first zero near 1 Hz
pulse width 0.10 s: spectrum height 0.100, first zero near 10 Hz
pulse width 0.01 s: spectrum height 0.010, first zero near 100 Hz
Pulse width times first-zero frequency stays equal to 1.
Modulation in practice
The modulation rule is how radio works: multiplying an audio signal (spectrum near 0) by a carrier copies its spectrum to . Many stations share the air because each occupies its own band. Multiplying again by the same carrier at the receiver moves a copy back to 0, where a low-pass filter recovers the audio.
In software
- Delay estimation (GPS, sonar, audio alignment) measures the linear phase across frequencies, or equivalently uses cross-correlation.
- Changing playback speed by a factor multiplies all frequencies by ; pitch-shifting without changing speed needs more elaborate tools (phase vocoders).
Exercises
Exercise 1: Delay and magnitude
Does delaying a signal change its magnitude spectrum?
Answer
No; only the phase changes.
Solution
, since the exponential has magnitude 1. The phase gains , a straight line in with slope proportional to the delay.
Exercise 2: Transform of a shifted, scaled rectangle
Find the transform of , a pulse of width 2 centered at .
Answer
.
Solution
has transform by scaling with . Delaying by 3 multiplies by .
Exercise 3: Linear phase (code)
Delay a Gaussian by and print the phase of its transform at . Is it a straight line?
Answer
Phases rad: a line with slope .
Solution
import numpy as np
dt = 0.001
t = np.arange(-20, 20, dt)
f = np.exp(-np.pi * (t - 0.25) ** 2)
for s in (0.2, 0.4, 0.6):
F = np.sum(f * np.exp(-2j * np.pi * s * t)) * dt
print(s, round(float(np.angle(F)), 4))0.2 -0.3142
0.4 -0.6283
0.6 -0.9425
Test yourself
If is compressed to , its spectrum…
- is compressed by 2
- is stretched by 2 and halved in height
- is unchanged
- is shifted by 2
Multiplying a signal by …
- delays it
- shifts its spectrum by
- scales its spectrum
- differentiates it
The transform of is…