TExcelTAD
Home › Fourier Analysis & Signals › Periodic Signals

Periodic Signals

A signal is periodic with period TT if x(t+T)=x(t)x(t + T) = x(t) for all tt. The smallest such T>0T > 0 is the fundamental period and f0=1/Tf_0 = 1/T the fundamental frequency. Fourier series exist precisely for periodic signals, so this lesson fixes the vocabulary: harmonics, sums of periodic signals, and the surprising rule for discrete-time periodicity.

Harmonics and sums

The functions e2πikf0te^{2\pi i k f_0 t} for integers kk all repeat with period T=1/f0T = 1/f_0; the kk-th one is the kk-th harmonic. A sum of periodic signals is periodic when the ratio of their periods is rational, and the period of the sum is the least common multiple.

python · try it yourself
from fractions import Fraction
from math import lcm

# periods in seconds: 1/3 s and 1/4 s (3 Hz and 4 Hz) -> period lcm = 1 s
T1, T2 = Fraction(1, 3), Fraction(1, 4)
num = lcm(T1.numerator * T2.denominator, T2.numerator * T1.denominator)
T = Fraction(num, T1.denominator * T2.denominator)
print("period of cos(6 pi t) + cos(8 pi t):", T, "s, fundamental", 1 / T, "Hz")

import numpy as np
t = np.linspace(0, 3, 3001)
x = lambda t: np.cos(6 * np.pi * t) + np.cos(8 * np.pi * t)
print("x(t + 1) == x(t):", np.allclose(x(t + 1), x(t)), "  x(t + 0.5) == x(t):", np.allclose(x(t + 0.5), x(t)))
period of cos(6 pi t) + cos(8 pi t): 1 s, fundamental 1 Hz
x(t + 1) == x(t): True   x(t + 0.5) == x(t): False

The fundamental frequency of the sum is gcd⁡(3,4)=1\gcd(3, 4) = 1 Hz, even though neither tone is at 1 Hz. Our ears do the same thing: a "missing fundamental" is heard as the pitch of a sum of harmonics.

cos⁡(t)+cos⁡(2 t)\cos(t) + \cos(\sqrt{2}\,t), by contrast, is never periodic: 2π2\pi and 2π/22\pi/\sqrt{2} have an irrational ratio.

Discrete-time periodicity is stricter

x[n]=cos⁡(ω0n)x[n] = \cos(\omega_0 n) is periodic only if ω0/(2π)\omega_0 / (2\pi) is a rational number m/Nm/N; then the period is NN (in lowest terms). And frequencies repeat: cos⁡(ω0n)\cos(\omega_0 n) and cos⁡((ω0+2π)n)\cos((\omega_0 + 2\pi) n) are the same sequence. Discrete-time frequencies live on a circle, not a line.

python · try it yourself
import numpy as np

n = np.arange(0, 24)
a = np.cos(2 * np.pi * 3 / 8 * n)            # omega/2pi = 3/8 -> period 8
b = np.cos(2 * np.pi * (3 / 8 + 1) * n)      # add 2 pi to omega
c = np.cos(1.0 * n)                          # omega/2pi = 1/(2pi), irrational
print("period 8:", np.allclose(a[:8], a[8:16]), np.allclose(a[:8], a[16:24]))
print("same sequence after adding 2 pi:", np.allclose(a, b))
print("cos(n) never repeats exactly; closest return in 1..1000:",
      min(range(1, 1001), key=lambda N: abs(np.cos(N) - 1)))
period 8: True True
same sequence after adding 2 pi: True
cos(n) never repeats exactly; closest return in 1..1000: 710

cos⁡(n)\cos(n) comes back close to 1 at n=710n = 710, because 710/(2π)≈113.0710/(2\pi) \approx 113.0 is nearly an integer (the famous approximation π≈355/113\pi \approx 355/113), but never exactly.

In software

  • Musical notes are periodic signals: an instrument's timbre is the pattern of its harmonic amplitudes (Audio Spectra and Pitch).
  • The circle of discrete frequencies is why np.fft.fftfreq returns negative frequencies in the second half of the array.

Exercises

Exercise 1: Fundamental period

Find the fundamental period of x(t)=sin⁡(10πt)+cos⁡(4πt)x(t) = \sin(10\pi t) + \cos(4\pi t).

Answer

T=1T = 1 s.

Solution

The frequencies are 5 Hz and 2 Hz, with periods 1/51/5 and 1/21/2 s. The fundamental frequency is gcd⁡(5,2)=1\gcd(5, 2) = 1 Hz, so T=1T = 1 s.

Exercise 2: Discrete period

What is the fundamental period of x[n]=cos⁡(3πn/10)x[n] = \cos(3\pi n / 10)?

Answer

N=20N = 20.

Solution

ω0/2π=3/20\omega_0 / 2\pi = 3/20 in lowest terms, so the period is 20 samples (the cosine goes through 3 full cycles in that time).

Exercise 3: Verify a period (code)

Check numerically that x[n]=cos⁡(3πn/10)x[n] = \cos(3\pi n/10) repeats after 20 samples but not after 10.

Answer

Period 20: True; period 10: False.

Solution
python · try it yourself
import numpy as np
n = np.arange(40)
x = np.cos(3 * np.pi * n / 10)
print(np.allclose(x[:20], x[20:40]), np.allclose(x[:10], x[10:20]))
True False

After 10 samples the phase has advanced by 3π3\pi, an odd multiple of π\pi, so the signal is negated, not repeated.

Test yourself

What is the fundamental frequency of cos⁡(2π⋅6t)+cos⁡(2π⋅9t)\cos(2\pi \cdot 6t) + \cos(2\pi \cdot 9t)?

  1. 6 Hz
  2. 9 Hz
  3. 3 Hz
  4. 54 Hz

When is cos⁡(ω0n)\cos(\omega_0 n) periodic?

  1. always
  2. when ω0/(2π)\omega_0/(2\pi) is rational
  3. when ω0\omega_0 is an integer
  4. never

Which discrete frequencies give the same sequence as ω0\omega_0?

  1. ω0+π\omega_0 + \pi
  2. ω0+2πk\omega_0 + 2\pi k
  3. 2ω02\omega_0
  4. ω0/2\omega_0/2