The time domain

Lecture 2 · Digital Signal Processing · University of Klagenfurt, 2022

Nunzio Alexandro Letizia

This lecture

Lecture 2 of 6

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

From Digital Signal Processing at the University of Klagenfurt, first taught in 2020: this is the edition of summer 2022, 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.

Ex. 1

  1. Find the period of the continuous-time signals
    • \sin^2(t)
    • 4\sin(t)\cos^2(t)-\sin(t)
  2. Find the period of the discrete-time signals
    • \cos(2\pi f_0kT), with f_0=\frac{1}{256T}
    • \sin(k)

Ex. 1: solutions

1. With \sin^2t=\frac{1-\cos2t}{2}, the signal repeats when \cos(2t+2T_0)=\cos2t, that is 2T_0=2\pi:

\sin^2(t)\ \Rightarrow\ T_0=\pi

With \cos^2t=\frac{1+\cos2t}{2} and \sin\alpha+\sin\beta=2\sin\frac{\alpha+\beta}{2}\cos\frac{\alpha-\beta}{2}:

4\sin t\cos^2t-\sin t=\sin t+2\sin t\cos2t=\sin t+\sin3t+\sin(-t)=\sin3t\ \Rightarrow\ T_0=\frac{2\pi}{3}

2. A discrete signal is periodic if x(kT)=x(kT+NT) for an integer N:

\cos\left(2\pi f_0kT+2\pi f_0NT\right)=\cos(2\pi f_0kT)\iff f_0NT=\frac{N}{256}\in\mathbb{Z}\ \Rightarrow\ N=256,\quad T_0=256\,T

For \sin(k), with T=1, we need N=2\pi m with m integer: impossible, since \pi is irrational. \sin(k) is not periodic, although \sin(t) is.

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.

Ex. 2

Express in polar coordinates:

  1. the complex number \left(1+j\sqrt3\right)^n. For which positive integers n is it real?
  2. the complex signal (j\cdot t)^j, with 0<t<2\pi;
  3. the complex signal \sqrt{1+j\sqrt{\dfrac{1-\cos(4t)}{1+\cos(4t)}}}, with 0<t<\frac\pi4.

Ex. 2: solutions

1. |1+j\sqrt3|=2 and \arctan\sqrt3=\frac\pi3, so \left(1+j\sqrt3\right)^n=2^n\,e^{j\pi n/3}. It is real when \frac{\pi n}{3} is a multiple of \pi: for n=3,6,9,\dots (-8 for n=3, 64 for n=6).

2. For t>0, jt=t\,e^{j\pi/2} and t=e^{\ln t}:

(jt)^j=t^j\,e^{j\cdot j\frac\pi2}=e^{-\pi/2}\,e^{j\ln t}

a constant magnitude e^{-\pi/2}\approx0.21 and a phase \ln t: the signal runs on a circle.

3. With \frac{1-\cos4t}{1+\cos4t}=\tan^22t, and \tan2t>0, \cos2t>0 for 0<t<\frac\pi4:

1+j\tan2t=\frac{1}{\cos2t}\,e^{j2t}\ \Rightarrow\ \sqrt{1+j\tan2t}=\frac{1}{\sqrt{\cos2t}}\,e^{jt}

A circle of radius e to the minus pi over two, centred at the origin of the complex plane.

item 2: (jt)^j in the complex plane

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

Finite area means zero mean; finite energy means zero power. Periodic signals: mean and power over one period. Discrete time: A(x)=T\sum_kx(kT), E(x)=T\sum_k|x(kT)|^2.

Elementary signals

1(t)=\begin{cases}1&t>0\\0&t<0\end{cases}\qquad \mathrm{rect}(t)=\begin{cases}1&|t|<\frac12\\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). In discrete time, 1_0(kT) is the step: 1 for k\ge0, 0 for k<0.

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

Ex. 3

  1. Evaluate the area of x(t)=\mathrm{rect}\left(\frac{-6t+7}{8}\right).
  2. Evaluate the area of
    1. x(t)=\prod_{n=0}^{+\infty}\frac{1}{2^n}\,\mathrm{rect}\left(t\cdot2^n\right)
    2. x(t)=\sum_{n=0}^{+\infty}\frac{1}{2^n}\,\mathrm{rect}\left(t\cdot2^n\right)
  3. Evaluate the area of x(t)=e^{-\alpha t}\cdot1(t), with \alpha>0.
  4. Evaluate the energy of x(kT)=0.5^{|k-1|}\cdot1_0(kT-5T).
  5. Evaluate the energy and the power of x(t)=\cos(2\pi f_0t+\varphi).

Ex. 3: solutions

1. The rect is even, so \mathrm{rect}\left(\frac{-6t+7}{8}\right)=\mathrm{rect}\left(\frac{t-\frac76}{\frac43}\right): a pulse of width D=\frac43, and A(x)=\frac43.

2a. The n-th factor has width and height 2^{-n}: the product lives on the narrowest pulse and its height \prod_n2^{-n} goes to 0. So x(t)=0 and A(x)=0.

2b. The areas add up, a geometric series:

A(x)=\sum_{n=0}^{\infty}\frac{1}{2^n}\cdot\frac{1}{2^n}=\sum_{n=0}^{\infty}\left(\frac14\right)^n=\frac{1}{1-\frac14}=\frac43

a stack of pulses with peak value 1+\frac12+\frac14+\dots=2 at t=0.

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

Ex. 3: solutions, continued

4. The step keeps only k\ge5, so

E(x)=T\sum_{k=5}^{+\infty}0.25^{\,k-1}=T\sum_{\ell=4}^{+\infty}0.25^{\ell}=T\left(\frac{1}{1-\frac14}-\frac{1-\left(\frac14\right)^5}{1-\frac14}\right)=\frac{T}{192}

5. Over one period T_0=1/f_0, with \cos^2\alpha=\frac{1+\cos2\alpha}{2}:

\int_{-T_0/2}^{T_0/2}\cos^2(2\pi f_0t+\varphi)\,dt=\frac{T_0}{2}+\underbrace{\frac{\sin(4\pi f_0t+2\varphi)}{8\pi f_0}\bigg|_{-T_0/2}^{T_0/2}}_{0}=\frac{T_0}{2}

That is the energy of one period: the cosine itself has infinite energy, and its power is

P(x)=\frac{1}{T_0}\cdot\frac{T_0}{2}=\frac12

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

and in discrete time z(kT)=T\sum_{\ell}x(\ell T)\,y(kT-\ell T).

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), where \mathrm{triangle}(t)=1-|t| for |t|<1, 0 elsewhere.

Ex. 4

Compute the convolution z=x*y for:

  1. a generic x(t) and y(t)=\delta(t);
  2. x(kT)=y(kT)=0.5^k\cdot1_0(kT);
  3. x(t)=y(t)=e^{-\pi t^2} (optional);
  4. y(t)=x*x*x(t), with x(t)=\mathrm{rect}(t) (from an exam of Communications Engineering, 2021; optional).

Ex. 4: solutions

1. Only \tau=t contributes: \ x*\delta(t)=\int x(\tau)\,\delta(t-\tau)\,d\tau=x(t). Likewise x*\frac12\delta(t-1)=\frac12x(t-1).

2. The two steps overlap for 0\le\ell\le k:

z(kT)=T\sum_{\ell}0.5^{\ell}\,1_0(\ell T)\cdot0.5^{k-\ell}\,1_0(kT-\ell T)=T\,0.5^k\sum_{\ell=0}^{k}1=(k+1)\,0.5^k\,T\cdot1_0(kT)

so z=T\,(1,\ 1,\ 0.75,\ 0.5,\ 0.3125,\dots) for k=0,1,2,\dots and 0 before.

3. Completing the square in the exponent, z(t)=\frac{1}{\sqrt2}\,e^{-\pi t^2/2}: Gaussians stay Gaussian, wider by \sqrt2.

4. \mathrm{rect}*\mathrm{rect}=\mathrm{triangle}, then one more rect:

y(t)=\mathrm{triangle}*\mathrm{rect}(t)=\begin{cases}\frac34-t^2&|t|<\frac12\\[2pt]\frac12\left(\frac32-|t|\right)^2&\frac12\le|t|<\frac32\\[2pt]0&\text{elsewhere}\end{cases}

Items 3 and 4 had no written solution in my notes for this course: item 3 follows my solution for Communications Engineering, item 4 is added for the web version.