The time domain

Lecture 2 · Communications Engineering · University of Klagenfurt, 2023

Nunzio Alexandro Letizia

This lecture

Lecture 2 of 6

  1. Deterministic signals, real and complex
  2. Area, mean, energy and power; the elementary signals
  3. The convolution

From Communications Engineering at the University of Klagenfurt, first taught in 2020: this is the edition of winter 2023, so some of it may be a little dated. All lectures.

Signals in time

01

Deterministic signals

A deterministic signal is a function x:I\to\mathbb{C}, x(t)\in\mathbb{C}, where I is the time domain. In other words, a signal that a mathematical formula describes exactly.

Aperiodic signals

  • continuous time, x(t), with I=\mathbb{R}
  • discrete time, x(kT), with I=\mathbb{Z}(T), the multiples of the step T
The same signal in continuous time, a smooth curve, and in discrete time, its samples drawn as stems.

Periodic signals

  • continuous time: x(t)=x(t+T_0), with I=\mathbb{R}/\mathbb{Z}(T_0)
  • discrete time, with period T_0=NT: x(kT)=x(kT+NT), with I=\mathbb{Z}(T)/\mathbb{Z}(NT)
The signal of the previous slide repeated every T0, in continuous and in discrete time.

Complex signals

A complex signal has two coordinates:

  • Cartesian form, x(t)=\mathrm{Re}\{x(t)\}+j\,\mathrm{Im}\{x(t)\}
  • polar form, x(t)=|x(t)|\,e^{j\theta(t)}, with \theta(t)=\arg\{x(t)\}; for a complex exponential e^{j2\pi f_0t}, \theta(t)=2\pi f_0t

The magnitude and the phase are

|x(t)|=\sqrt{\mathrm{Re}\{x(t)\}^2+\mathrm{Im}\{x(t)\}^2},\qquad \theta(t)=\arctan\left(\frac{\mathrm{Im}\{x(t)\}}{\mathrm{Re}\{x(t)\}}\right)\ \text{ if }\mathrm{Re}\{x(t)\}>0

(add \pi when \mathrm{Re}\{x(t)\}<0). Below, x(t)=\mathrm{sinc}(t)+j\,\frac{1}{1+(\pi t)^2}:

The complex signal sinc of t plus j over one plus pi t squared: its curve in the complex plane, its magnitude and its phase.

Operations on signals

  • Flipping reverts the signal in time: x(-t)
  • Translation by t_0 moves it along the time axis: x(t-t_0)
  • Scaling narrows or broadens its shape: x(t/a)
Three panels: a signal and its flipped copy, a signal and its copy delayed by t0, a signal stretched by two and compressed by two.

Definitions

  • Extension: e(x)=(t_0,t_1) such that x(t)=0 for t\notin e(x)
  • Duration: the measure of e(x), written D(x)
  • Causal signal: its minimum extension is contained in [0,+\infty)

Area

A(x)=\int_{-\infty}^{+\infty}x(t)\,dt

Mean value

m(x)=\lim_{T\to+\infty}\frac{1}{T}\int_{-T/2}^{T/2}x(t)\,dt

Energy

E(x)=\int_{-\infty}^{+\infty}|x(t)|^2\,dt

Power

P(x)=\lim_{T\to+\infty}\frac{1}{T}\int_{-T/2}^{T/2}|x(t)|^2\,dt

If the area is finite, |A(x)|<M, the mean is 0; a finite energy signal, 0<E(x)<\infty, has zero power. For periodic signals, mean and power are taken over one period T_0.

Elementary signals

1(t)=\begin{cases}1&t>0\\\frac12&t=0\\0&t<0\end{cases}\qquad \mathrm{sgn}(t)=\begin{cases}1&t>0\\0&t=0\\-1&t<0\end{cases}

\mathrm{rect}(t)=\begin{cases}1&|t|<\frac12\\0&\text{elsewhere}\end{cases}\qquad \mathrm{triangle}(t)=\begin{cases}1-|t|&|t|<1\\0&\text{elsewhere}\end{cases}\qquad \mathrm{sinc}(t):=\frac{\sin\pi t}{\pi t}

The Dirac impulse \delta(t) is zero for t\neq0 and has unit area. It is defined by the sifting property

\int_{-\infty}^{+\infty}x(t)\,\delta(t-t_0)\,dt=x(t_0)

Elementary signals, drawn

Six small plots: the step, the rect, the sinc, the sign, the triangle and the Dirac impulse drawn as an arrow.

Ex. 1

  1. Evaluate the area, mean, energy and power of x(t)=\mathrm{rect}\left(\frac{t-t_0}{D}\right).
  2. Evaluate the area, mean, energy and power of x(t)=\mathrm{triangle}\left(\frac{t}{D}\right).
  3. Evaluate the area of x(t)=\mathrm{sinc}(t).
  4. Evaluate the area, mean, energy and power of x(t)=\sum_{k\in\mathbb{Z}}\mathrm{rect}\left(\frac{t-kT_0}{D}\right), with T_0>D.
  5. Evaluate the area, mean, energy and power of x(t)=\sum_{k\in\mathbb{Z}}\mathrm{triangle}\left(\frac{t-kT_0}{D}\right), with T_0>2D.
  6. Evaluate the area of x(t)=e^{-\alpha t}\cdot1(t), with \alpha>0.
  7. Evaluate the energy and power of x(t)=\cos(2\pi f_0t+\varphi).

Ex. 1: solutions, the pulses

1. The pulse is 1 on \left[t_0-\frac D2,t_0+\frac D2\right] and takes only the values 0 and 1, so |x|^2=x:

A(x)=\int_{t_0-\frac D2}^{t_0+\frac D2}1\,dt=D,\qquad m(x)=\lim_{T\to+\infty}\frac{D}{T}=0,\qquad E(x)=D,\qquad P(x)=0

2. The area of a triangle with base 2D and height 1 is D, and m(x)=0 as before. For the energy:

E(x)=\int_{-D}^{D}\left(1-\left|\tfrac tD\right|\right)^2dt=2\int_0^D\left(1-\tfrac tD\right)^2dt=\left[-2D\,\frac{\left(1-\frac tD\right)^3}{3}\right]_0^D=\frac{2D}{3},\qquad P(x)=0

6. \displaystyle A(x)=\int_0^{+\infty}e^{-\alpha t}\,dt=\left.\frac{e^{-\alpha t}}{-\alpha}\right|_0^{+\infty}=\frac{1}{\alpha}

Ex. 1: solutions, the area of the sinc

3. By symmetry A(\mathrm{sinc})=2I(0), with I(u)=\displaystyle\int_0^{+\infty}\frac{\sin(\pi t)}{\pi t}\,e^{-\pi tu}\,dt. Differentiate under the integral sign:

I'(u)=-\int_0^{+\infty}\sin(\pi t)\,e^{-\pi tu}\,dt

Integrating by parts twice brings back the same integral:

I'(u)=-\frac{1}{\pi u^2}-\frac{1}{u^2}I'(u)\ \Longrightarrow\ I'(u)=-\frac{1}{\pi}\,\frac{1}{1+u^2}\ \Longrightarrow\ I(u)=-\frac{1}{\pi}\arctan(u)+C

Since I(u)\to0 as u\to+\infty, C=\frac12, so I(0)=\frac12 and

A(\mathrm{sinc})=1

It is also \mathrm{rect}(0), the Fourier transform of the sinc at f=0: lecture 3.

Ex. 1: solutions, periodic signals

For a periodic signal the area and the energy are infinite: we compute them over one period, on x_0(t), and the mean and power follow.

4. x_0(t)=\mathrm{rect}(t/D): \quad A(x_0)=D,\quad E(x_0)=D,\quad m(x)=\dfrac{D}{T_0},\quad P(x)=\dfrac{E(x_0)}{T_0}=\dfrac{D}{T_0}

5. x_0(t)=\mathrm{triangle}(t/D): \quad A(x_0)=D,\quad E(x_0)=\dfrac{2D}{3},\quad m(x)=\dfrac{D}{T_0},\quad P(x)=\dfrac{2D}{3T_0}

7. With \cos^2\alpha=\frac{1+\cos2\alpha}{2}, over one period T_0=1/f_0:

E(x_0)=\int_{-\frac{T_0}{2}}^{\frac{T_0}{2}}\frac{1+\cos(4\pi f_0t+2\varphi)}{2}\,dt=\frac{T_0}{2}+0=\frac{1}{2f_0}

since the cosine integrates to zero over a whole period, whatever \varphi. So the energy of x is infinite and

P(x)=\frac{E(x_0)}{T_0}=\frac{1}{2}

The convolution

02

The convolution

The convolution expresses how the shape of one signal modifies the other. It is the output of a linear time-invariant (LTI) system:

z(t)=x*y(t):=\int_{-\infty}^{+\infty}x(\tau)\,y(t-\tau)\,d\tau

Properties: it is commutative, linear, time invariant (shift the input, the output shifts by as much) and associative.

  • Derive the properties.
  • Prove that A(x*y)=A(x)\cdot A(y), where A(x) is the area of x(t).

Two rectangles

Convolve x(t)=A_1\,\mathrm{rect}\left(\frac{t}{T_1}\right) and y(t)=A_2\,\mathrm{rect}\left(\frac{t}{T_2}\right), with T_1>T_2: flip y, slide it by t, and integrate the overlap.

Left: the wide rect x and the narrow flipped rect y sliding across it. Right: their convolution, a trapezoid.

Two rectangles: the result

z(t)=\begin{cases}A_1A_2\left(t+\frac{T_1+T_2}{2}\right)&-\frac{T_1+T_2}{2}\le t<-\frac{T_1-T_2}{2}\\[2pt]A_1A_2T_2&-\frac{T_1-T_2}{2}\le t<\frac{T_1-T_2}{2}\\[2pt]A_1A_2\left(\frac{T_1+T_2}{2}-t\right)&\frac{T_1-T_2}{2}\le t<\frac{T_1+T_2}{2}\end{cases}

and 0 elsewhere. Check: the trapezoid has area \frac{(T_1+T_2)+(T_1-T_2)}{2}A_1A_2T_2=A_1T_1\cdot A_2T_2=A(x)A(y). With T_1=T_2 it becomes a triangle: A_1\mathrm{rect}\left(\frac{t}{T_1}\right)*A_2\mathrm{rect}\left(\frac{t}{T_1}\right)=A_1A_2T_1\,\mathrm{triangle}\left(\frac{t}{T_1}\right).

Ex. 2

Compute the convolution z(t)=x*y(t) for:

  1. a generic x(t) and y(t)=\delta(t);
  2. x(t)=\mathrm{rect}\left(\frac{t-\frac a2}{a}\right) and y(t)=\begin{cases}e^{t/b}-1&t\in[0,b]\\0&\text{otherwise}\end{cases}, with a<b;
  3. x(t)=y(t)=e^{-\pi t^2}.

Ex. 2: solutions

1. Only the instant \tau=t contributes, by the sifting property:

x*\delta(t)=\int_{-\infty}^{+\infty}x(\tau)\,\delta(t-\tau)\,d\tau=x(t)

\delta is the neutral element of the convolution.

3. Complete the square in the exponent, -\pi\tau^2-\pi(t-\tau)^2=-\left(\sqrt{2\pi}\,\tau-\sqrt{\tfrac\pi2}\,t\right)^2-\frac{\pi}{2}t^2, and set \lambda=\sqrt{2\pi}\,\tau-\sqrt{\tfrac\pi2}\,t:

z(t)=\frac{e^{-\frac{\pi t^2}{2}}}{\sqrt{2\pi}}\int_{-\infty}^{+\infty}e^{-\lambda^2}\,d\lambda=\frac{1}{\sqrt2}\,e^{-\frac{\pi t^2}{2}}

using \int e^{-\lambda^2}d\lambda=\sqrt\pi (square it and switch to polar coordinates). Check: A(z)=\frac{1}{\sqrt2}\sqrt2=1=A(x)A(y).

Ex. 2: solution of item 2

x(t-\tau) is 1 for \tau\in[t-a,t]. Slide it over y(\tau): five regions, two of them empty.

z(t)=\begin{cases}\displaystyle\int_0^t\left(e^{\tau/b}-1\right)d\tau=b\left(e^{t/b}-1\right)-t&0\le t<a\\[8pt]\displaystyle\int_{t-a}^t\left(e^{\tau/b}-1\right)d\tau=b\,e^{t/b}\left(1-e^{-a/b}\right)-a&a\le t<b\\[8pt]\displaystyle\int_{t-a}^b\left(e^{\tau/b}-1\right)d\tau=b\left(e-e^{(t-a)/b}\right)-(a+b-t)&b\le t<a+b\end{cases}

and 0 for t<0 and t\ge a+b. The result lasts D(z)=D(x)+D(y)=a+b, grows up to its maximum at t=b, then decays to zero, with area A(z)=a\cdot b(e-2)=A(x)A(y).

Item 2 in Matlab

a = 2;
b = 8;
% a < b important hypothesis

steps = 1e4; % granularity of time domain
delta = (a+b)/(steps-1); %width of time step
t = 0:delta:a+b; %time domain

v1 = find(t<=a);             %ZONE 2
v2 = find((t>a) & (t<=b));   %ZONE 3
v3 = find((t>b) & (t<=a+b)); %ZONE 4

y = zeros(size(t));
y(v1) = -b - t(v1) + b*exp(t(v1)/b);
y(v2) = -a - b*exp(t(v2)/b)*(exp(-a/b)-1);
y(v3) = b*(exp(1) - exp((t(v3)-a)/b) - 1) - a + t(v3);

plot(t,y,'b-','LineWidth',2);

The three non-empty regions of the solution, for a=2 and b=8. The expressions match the ones on the previous slide, rearranged.

No saved run of this script survives. What to expect: a curve that starts at 0, grows slowly over the first 2 seconds and faster up to t=8, where it peaks at b\,e\left(1-e^{-a/b}\right)-a\approx2.81, then falls back to 0 at t=10.