This Jupyter notebook is part of a collection of notebooks in the bachelors module Signals and Systems, Comunications Engineering, Universität Rostock. Please direct questions and suggestions to Sascha.Spors@uni-rostock.de.
Periodic signals are an import class of signals. Many practical signals can be approximated reasonably well as periodic functions. This holds especially when considering only a limited time-interval. Examples of periodic signals are superpositions of harmonic signals, signals captured from vibrating structures or rotating machinery, as well as speech signals or signals from musical instruments. The spectrum of a periodic signal exhibits specific properties which are discussed in the following.
A periodic signal $x(t)$ is a signal that repeats its values in regular periods. It has to fulfill
\begin{equation} x(t) = x(t + n \cdot T_\text{p}) \end{equation}for $n \in \mathbb{Z}$ where its period is denoted by $T_\text{p} > 0$. A signal is termed aperiodic if is not periodic. One period $x_0(t)$ of a periodic signal is given as
\begin{equation} x_0(t) = \begin{cases} x(t) & \text{for } 0 \leq t < T_\text{p} \\ 0 & \text{otherwise} \end{cases} \end{equation}A periodic signal can be represented by periodic summation of shifted copies of one period $x_0(t)$
\begin{equation} x(t) = \sum_{\mu = - \infty}^{\infty} x_0(t - \mu T_\text{p}) \end{equation}which can be rewritten as convolution
\begin{equation} x(t) = \sum_{\mu = - \infty}^{\infty} x_0(t) * \delta(t - \mu T_\text{p}) = x_0(t) * \sum_{\mu = - \infty}^{\infty} \delta(t - \mu T_\text{p}) \end{equation}using the sifting property of the Dirac impulse. It can be concluded that a periodic signal can be represented by one period $x_0(t)$ of the signal convolved with a series of Dirac impulses.
Example
The cosine signal $x(t) = \cos (\omega_0 t)$ has a periodicity of $T_\text{p} = \frac{2 \pi}{\omega_0}$. One period is given as
\begin{equation} x_0(t) = \cos (\omega_0 t) \cdot \text{rect} \left( \frac{t}{T_\text{p}} - \frac{T_\text{p}}{2} \right) \end{equation}Introduced into above representation of a periodic signal yields
\begin{align} x(t) &= \cos (\omega_0 t) \cdot \text{rect} \left( \frac{t}{T_\text{p}} - \frac{T_\text{p}}{2} \right) * \sum_{\mu = - \infty}^{\infty} \delta(t - \mu T_\text{p}) \\ &= \cos (\omega_0 t) \sum_{\mu = - \infty}^{\infty} \text{rect} \left( \frac{t}{T_\text{p}} - \frac{T_\text{p}}{2} - \mu T_\text{p} \right) \\ &= \cos (\omega_0 t) \end{align}since the sum over the shifted rectangular signals is equal to one.
The sum of shifted Dirac impulses, as used above to represent a periodic signal, is known as Dirac comb. The Dirac comb is defined as
\begin{equation} {\bot \!\! \bot \!\! \bot}(t) = \sum_{\mu = - \infty}^{\infty} \delta(t - \mu) \end{equation}It is used for the representation of periodic signals and for the modeling of ideal sampling. In order to compute the spectrum of a periodic signal, the Fourier transform of the Dirac comb $\mathcal{F} \{ {\bot \!\! \bot \!\! \bot}(t) \}$ is derived in the following. Fourier transformation of the left- and right-hand side of above definition yields
\begin{equation} \mathcal{F} \{ {\bot \!\! \bot \!\! \bot}(t) \} = \sum_{\mu = - \infty}^{\infty} e^{-j \mu \omega} \end{equation}The exponential function $e^{-j \mu \omega}$ for $\mu \in \mathbb{Z}$ is periodic with a period of $2 \pi$. Hence, the Fourier transform of the Dirac comb is also periodic with a period of $2 \pi$.
In order to gain further insight, the following convolution of a rectangular signal with a Dirac comb is considered
\begin{equation} {\bot \!\! \bot \!\! \bot}(t) * \text{rect}(t) = 1 \end{equation}The right hand side follows from the fact that the rectangular signals equals one for $-\frac{1}{2} < t < \frac{1}{2}$ which is then periodically summed up with a period of one. Fourier transform of the left- and right-hand side yields
\begin{equation} \mathcal{F} \{ {\bot \!\! \bot \!\! \bot}(t) \} \cdot \text{sinc}\left(\frac{\omega}{2}\right) = 2 \pi \delta(\omega) \end{equation}For $\text{sinc}( \frac{\omega}{2} ) \neq 0$, which is equal to $\omega \neq 2 n \cdot \pi$ with $n \in \mathbb{Z} \setminus \{0\}$, this can be rearranged to
\begin{equation} \mathcal{F} \{ {\bot \!\! \bot \!\! \bot}(t) \} = 2 \pi \, \delta(\omega) \cdot \frac{1}{\text{sinc}\left(\frac{\omega}{2}\right)} = 2 \pi \, \delta(\omega) \end{equation}Note that the multiplication property of the Dirac impulse and $\text{sinc}(0) = 1$ has been used to derive the last equality. The Fourier transform is now known in the interval $-2 \pi < \omega < 2 \pi$. It has already been concluded that the Fourier transform is periodic with a period of $2 \pi$. Hence, the Fourier transformation of the Dirac comb can be derived by periodic continuation
\begin{equation} \mathcal{F} \{ {\bot \!\! \bot \!\! \bot}(t) \} = \sum_{\mu = - \infty}^{\infty} 2 \pi \, \delta(\omega - 2 \pi \mu) = \sum_{\mu = - \infty}^{\infty} 2 \pi \, \left( \frac{\omega}{2 \pi} - \mu \right) \end{equation}The last equality follows from the scaling property of the Dirac impulse. Using the definition of the Dirac comb, the Fourier transform can now be rewritten in terms of the Dirac comb
\begin{equation} \mathcal{F} \{ {\bot \!\! \bot \!\! \bot}(t) \} = {\bot \!\! \bot \!\! \bot} \left( \frac{\omega}{2 \pi} \right) \end{equation}The Fourier transform of a Dirac comb with unit distance between the Dirac impulses is a Dirac comb with a distance of $2 \pi$ between the Dirac impulses which are weighted by $2 \pi$.
Example
The following example computes the truncated series
\begin{equation} X(j \omega) = \sum_{\mu = -M}^{M} e^{-j \mu \omega} \end{equation}as approximation of the Fourier transform $\mathcal{F} \{ {\bot \!\! \bot \!\! \bot}(t) \}$ of the Dirac comb. For this purpose the sum is defined and plotted in SymPy
.
%matplotlib inline
import sympy as sym
sym.init_printing()
mu = sym.symbols('mu', integer=True)
w = sym.symbols('omega', real=True)
M = 20
X = sym.Sum(sym.exp(-sym.I*mu*w), (mu, -M, M)).doit()
sym.plot(X, xlabel='$\omega$', ylabel='$X(j \omega)$', adaptive=False, nb_of_points=1000);
Exercise
In order to derive the Fourier transform $X(j \omega) = \mathcal{F} \{ x(t) \}$ of a periodic signal $x(t)$ with period $T_\text{p}$, the signal is represented by one period $x_0(t)$ and the Dirac comb. Rewriting above representation of a periodic signal in terms of a sum of Dirac impulses by noting that $\delta(t - \mu T_\text{p}) = \frac{1}{T_\text{p}} \delta(\frac{t}{T_\text{p}} - \mu)$ yields
\begin{equation} x(t) = x_0(t) * \frac{1}{T_\text{p}} {\bot \!\! \bot \!\! \bot} \left( \frac{t}{T_\text{p}} \right) \end{equation}The Fourier transform is derived by application of the convolution theorem
\begin{align} X(j \omega) &= X_0(j \omega) \cdot {\bot \!\! \bot \!\! \bot} \left( \frac{\omega T_\text{p}}{2 \pi} \right) \\ &= \frac{2 \pi}{T_\text{p}} \sum_{\mu = - \infty}^{\infty} X_0 \left( j \, \mu \frac{2 \pi}{T_\text{p}} \right) \cdot \delta \left( \omega - \mu \frac{2 \pi}{T_\text{p}} \right) \end{align}where $X_0(j \omega) = \mathcal{F} \{ x_0(t) \}$ denotes the Fourier transform of one period of the periodic signal. From the last equality it can be concluded that the Fourier transform of a periodic signal consists of a series of weighted Dirac impulses. These Dirac impulse are equally distributed on the frequency axis $\omega$ at an interval of $\frac{2 \pi}{T_\text{p}}$. The weights of the Dirac impulse are given by the values of the spectrum $X_0(j \omega)$ of one period at the locations $\omega = \mu \frac{2 \pi}{T_\text{p}}$. Such a spectrum is termed line spectrum.
Parseval's theorem relates the energy of a signal in the time domain to its spectrum. The energy of a periodic signal is in general not defined. This is due to the fact that its energy is unlimited, if the energy of one period is non-zero. As alternative, the average power of a periodic signal $x(t)$ is used. It is defined as
\begin{equation} P = \frac{1}{T_\text{p}} \int_{0}^{T_\text{p}} |x(t)|^2 \; dt \end{equation}Introducing the Fourier transform of a periodic signal into Parseval's theorem yields
\begin{equation} \frac{1}{T_\text{p}} \int_{0}^{T_\text{p}} |x(t)|^2 \; dt = \frac{1}{T_\text{p}} \sum_{\mu = - \infty}^{\infty} \left| X_0 \left( j \, \mu \frac{2 \pi}{T_\text{p}} \right) \right|^2 \end{equation}The average power of a periodic signal can be calculated in the time-domain by integrating over the squared magnitude of one period or in the frequency domain by summing up the squared magnitude weights of the coefficients of the Dirac impulses of its Fourier transform.
The pulse train is commonly used for power control using pulse-width modulation (PWM). It is constructed from a periodic summation of a rectangular signal $x_0(t) = \text{rect} (\frac{t}{T} - \frac{T}{2})$
\begin{equation} x(t) = \text{rect} \left( \frac{t}{T} - \frac{T}{2} \right) * \frac{1}{T_\text{p}} {\bot \!\! \bot \!\! \bot} \left( \frac{t}{T_\text{p}} \right) \end{equation}where $0 < T < T_\text{p}$ denotes the width of the pulse and $T_\text{p}$ its periodicity. Its usage for power control becomes evident when calculating the average power of the pulse train
\begin{equation} P = \frac{1}{T_\text{p}} \int_{0}^{T_\text{p}} | x(t) |^2 dt = \frac{T}{T_\text{p}} \end{equation}The Fourier transform of one period $X_0(j \omega) = \mathcal{F} \{ x_0(t) \}$ is derived by applying the scaling and shift theorem of the Fourier transform to the Fourier transform of the retangular signal
\begin{equation} X_0(j \omega) = e^{-j \omega \frac{T}{2}} \cdot T \, \text{sinc} \left( \frac{\omega T}{2} \right) \end{equation}from which the spectrum of the pulse train follows by application of above formula for the Fourier transform of a periodic signal
\begin{equation} X(j \omega) = 2 \pi \frac{1}{T_\text{p}} \sum_{\mu = - \infty}^{\infty} e^{-j \mu \pi \frac{T}{T_\text{p}}} \cdot T \, \text{sinc} \left( \mu \pi \frac{T}{T_\text{p}} \right) \cdot \delta \left( \omega - \mu \frac{2 \pi}{T_\text{p}} \right) \end{equation}Example
The pulse train and its spectrum are illustrated by the subsequent computational example. First the pulse train is defined and plotted in SymPy
mu = sym.symbols('mu', integer=True)
t = sym.symbols('t', real=True)
T = 2
Tp = 5
def pulse_train(T, Tp):
n = sym.symbols('n', integer=True)
x0 = sym.Piecewise((0, t < 0), (1, t < T), (0, True))
return sym.summation(x0.subs(t, t+n*Tp), (n, -10, 10))
import warnings
warnings.filterwarnings("ignore", module="sympy.plot")
sym.plot(pulse_train(T, Tp), (t, -5, 20), xlabel='$t$', ylabel='$x(t)$', adaptive=False);
The weights of the Dirac impulses are defined for fixed values $T$ and $T_\text{p}$
X_mu = sym.exp(-sym.I * mu * sym.pi * T/Tp) * T * sym.sinc(mu * sym.pi * T/Tp)
X_mu
The weights of the Dirac impulses are plotted with matplotlib
, a Python plotting library. The library expects the values of the function to be plotted at a series of sampling points. In order to create these, the function sympy.lambdify
is used which numerically evaluates a symbolic function at given sampling points. The resulting plot illustrates the positions and weights of the Dirac impulses.
import numpy as np
import matplotlib.pyplot as plt
Xn = sym.lambdify(mu, sym.Abs(X_mu), 'numpy')
n = np.arange(-15, 15)
plt.stem(n*2*np.pi/Tp, Xn(n))
plt.xlabel('$\omega$')
plt.ylabel('$|X(j \omega)|$');
Exercise
Copyright
The notebooks are provided as Open Educational Resource. Feel free to use the notebooks for your own educational purposes. The text is licensed under Creative Commons Attribution 4.0, the code of the IPython examples under the MIT license. Please attribute the work as follows: Lecture Notes on Signals and Systems by Sascha Spors.