Introducing Signals and Systems

An annotatable copy of the full notes for this presentation are to be found in the _Content Library of the OneNote Class Notebook for this class. You can also view the notes for this presentation as a webpage (HTML) and as a downloadable PDF file.

Signals and Systems for Dummies

Signals and Systems for Dummies (SS4D) provides a useful introduction to the topics that will be covered in this module and it is in the Reading List as a recommended text. I have based this presentation on Chapter 1 which is available as a downloadable PDF from the publishers.

You should read Chapter 1 of SS4D in conjunction with the notes for this presentation.

Agenda

  • Continuous-time signals
  • Continuous-time systems
  • Discrete-time signals
  • Discrete-time systems
  • Signal Classifications
  • Domains for Signals
  • Systems Thinking and Systems Design

These will be illustrated with computation in Wolfram|Alpha, Matlab, Simulink.

Continuous-time signals

Continuous signals are represented mathematically by functions which vary continuously with time.

Sinusoidal signals (e.g. AC) are pretty fundamental in electrical engineering. The mathematical model of a sinusoidal signal is:

$$x(t) = A \cos (2\pi f_0 t - \phi).$$

Without talking to your anyone, match each of the symbols to its definition

Symbol Definition
$A$ Phase in radians
$f_0$ Frequency in Hz
$\phi$ Amplitude
$2\pi f_0$ Frequency in rad/s

-> Open Poll

Gaining insight using computers

To help us answer these questions, let's use our Mathematical tools to plot a signal like this and explore it. The example we will use is from Signals and Systems for Dummies (SS4D: page 12):

$$3\cos(2\pi\cdot 2t - 3\pi/4)$$

Wolfram|Alpha

Here's the link: http://www.wolframalpha.com

Paste this into the search box

plot 3 cos(2 pi 2 t - 3 pi/4) 

Matlab

In Matlab we would need to tackle this by breaking down the steps.

Define t

In [4]:
t = linspace(0, 1, 100);

Define x

In [5]:
x = 3 * cos(2*pi*2*t - 3*pi/4);

Plot result and label plot

In [6]:
plot(t,x)
title('A Sinusoidal Signal')
xlabel('Time t (s)')
ylabel('Amplitude')
grid

Returning to the Question

Sinusoidal signals (e.g. AC) are pretty fundamental in electrical engineering. The mathematical model of a sinusoidal signal is:

$$x(t) = A \cos (2\pi f_0 t - \phi).$$

Using the insight just gained by exploring this function with a computer, try matching each of the symbols to its definition again.

This time you may confer!!

Symbol Definition
$A$ Phase in radians
$f_0$ Frequency in Hz
$\phi$ Amplitude
$2\pi f_0$ Frequency in rad/s

Supplementary question

What is the period of the waveform in seconds?

  1. $2\pi$
  2. $f_0$
  3. $t$
  4. $1/f_0$
  5. $2\pi/f_0$

-> Open poll

Continuous-time Systems

Systems operate on signals. In mathematical terms, a system is a function or an operator, $H\{\}$ that maps the input signal $x(t)$ to an output signal $y(t)$.

Mathematically we would write this:

$$y(t) = H\{x(t)\}.$$

Example

An example of a continuous-time system is an electronic amplifier with a gain of 5 and level shift of 2: $y(t) = H\{x(t)\} = 5x(t) + 2$.

In this course, we will model such systems as block diagram models in Simulink.

The Similink code can be downloaded from this file gain_level_shift.slx.

Demonstration

If the input to this system is replaced with a sinewave $x(t)=\sin(t)$ and the output with a scope, what do you think the output will be?






If you get a chance, try this in youself in Matlab and copy the result into your copy of these notes.

In [7]:
open gain_level_shift

Discrete-time Signals

Disrete-time signals are a function of a time index $n$. A discrete-time signal $x[n]$, unlike a continuous-time signal $x(t)$, is only defined at integer values of the independent variable $n$. This means that the signal is only active at specific periods of time. Discrete-time signals can be stored in computer memory.

Example

Consider the following simple signal, a pulse sequence:$$y[n] = \left\{ {\begin{array}{*{20}{c}} {5,\;0 \le n < 10}\\ {0,\;{\rm{otherwise}}\quad \;} \end{array}} \right.$$ We can plot this in Matlab as a stem plot

Procedure

Define function and save as y.m.

In [8]:
open y
In [9]:
%% Define sample points
n = -15:18;
%% Make space for the signal
xn = zeros(size(n));

%% Compute the signal x[n]
for i = 1:length(xn)
    xn(i) = y(n(i));
end
In [10]:
%% Plot the result
stem(n,xn)
axis([-15, 18, 0, 6])
title('Stem Plot for a Discrete Signal')
xlabel('Sample n')
ylabel('Signal x[n]')
grid

Exercise

Draw a digital signal that represents your student number in some way. For example if your number was 765443, then you could generate a signal for which $x[n] = 0$ when $n < 7$, then $x[n] = 7$ for $7$ periods, then $x[n] = 6$ for the next 6 periods, $x[n] = 5$ for 5 periods, and so on. The signal should return to 0 when the last digit has been transmitted.










To plot this on a computer you would need to transcribe $x[n]$ into an array and then use the stem plot to plot the data. You could just create the array by hand, but you could also create a Matlab function if you would like a challenge.

Discrete-time Systems

A discrete-time system, like its continuous-time counterpart, is a function, $H\{\}$, that maps the input $x[n]$ to the output $y[n] = H\{x[n]\}$. An example of a discrete-time system is the two-tap filter:

$$y[n] = H\{x[n]\} = \frac{3}{4}x[n] + \frac{1}{4}x[n-1]$$

The term tap denotes that output at time instant $n$ is formed from two time instants of the input, $n$ and $n – 1$. Check out a block diagram of a two-tap filter system:

This system is available as a Simulink model discrete_system.slx

In [11]:
open discrete_system

Signal Classifications

Periodic

Signals that repeat over and over are said to be periodic. In mathematical terms, a signal is periodic if:

  • Continuous signal $x(t + T) = x(t)$
  • Discrete signal $x[n + N] = x[n]$

The smallest $T$ or $N$ for which the equality holds is the signal period.

Square Wave

This code generates a square wave.

See [periodic.b(matlab/periodic.m).

In [12]:
%% A Periodic signal (square wave)
t = linspace(0, 1, 500);
x = square(2 * pi * 5 * t);
In [13]:
plot(t, x);
ylim([-2, 2]);
grid()
title('A Periodic Signal')
xlabel('Time t (s)')
ylabel('Amplitude')

$T = $?

Question

For the example we started with $x(t) = 2 \cos (2\pi . 2t + 3\pi/4)$. Say we sample the cosine wave at 20 times the frequency of the sinusoid, what would the sampling period be and what would $N$ be for the sampled waveform?

Aperiodic

Signals that are deterministic (completely determined functions of time) but not periodic are known as aperiodic. Point of view matters. If a signal occurs infrequently, you may view it as aperiodic.

This is how we generate an aperiodic rectangular pulse of duration $\tau$ in Matlab:

See aperiodic.m

In [14]:
%% An aperiodic function
tau = 1;
x = linspace(-1,5,1000);
y = rectangularPulse(0,tau,x);
In [15]:
plot(x,y)
ylim([-0.2,1.2])
grid
title('An Aperiodic Signal')
xlabel('Time t (s)')
ylabel('Amplitude')

Random

A signal is random if one or more signal attributes takes on unpredictable values in a probability sense.  Engineers working with communication receivers are concerned with random signals, especially noise.

See: random.m

In [16]:
%% Plot a Random Signal
plot(0.5 + 0.25 * rand(100,1))
ylim([0,1])
grid
title('Random Signal')
xlabel('Time t (s)')
ylabel('Amplitude')

Domains for Signals and Systems

Most of the signals we encounter on a daily basis reside in the time domain. They’re functions of independent variable $t$ or $n$. But sometimes when you’re working with continuous-time signals, you may need to transform away from the time domain ($t$) to another domain.

Domain Quiz

A domain which is used in the analysis of signals and the design of systems is represented by complex numbers of the form:

$$\sigma + j\omega$$

Without conferring, tell me what domain is this?

-> Open Poll

Now discuss your answer with your peers

Domain Quiz (again)

A domain which is used in the analysis of signals and the design of systems is represented by complex numbers of the form:

$$\sigma + j\omega$$

Tell me what domain is this?

-> Open Poll

Other Domains you will encounter

The most commnly used domains used when analysing continuous time signals are the frequency domain ($f$ or $\omega$) or the Laplace $s$-domain ($s$).

Similarly, for discrete-time signals, you may need to transform from the discrete-time domain ($n$) to the frequency domain ($\hat{\omega}$) or the z-domain ($z$).

This section briefly introduces the world of signals and systems in the frequency, s-, and z-domains. More on these domains will follow.

Consider the sum of a two-sinusoids signal $$x(t) = \underbrace {A_1\cos(2\pi f_1 t)}_{s_1} + \underbrace {A_2\cos(2\pi f_2 t)}_{s_2}$$

In [17]:
two_sines

Fourier Transform

We use the Fourier transform to move away from the time domain and into the frequency domain. To get back to the time domain, use the inverse Fourier transform. We will found out more about these transforms in this module.

Laplace and Z-Transform Domains

From the time domain to the frequency domain, only one independent variable, $t \to f$, exists. When a signal is transformed to the s-domain, it becomes a function of a complex variable $s=\sigma + j\omega$. The two variables (real and imaginary parts) describe a location in the s-plane.

In addition to visualization properties, the s-domain reduces differential equation solving to algebraic manipulation. For discrete-time signals, the z-transform accomplishes the same thing, except differential equations are replaced by difference equations.

Systems Thinking and Systems Design

See section Testing Product Concepts with Behavioral Level Modeling from Chapter 1 of SS4D (pages 18--20) and add some notes to summarize this for yourself.

  • We will use behavioural modelling
  • We will rely on abstraction
  • We work top-down
  • We make use of mathematics and mathematical software.

Familiar Signals and Systems

See pages 21-23 of the free sample (Chapter 1) of SS4D for notes and details.

Challenge

I used the examples from Signals and Systems for Dummies to seed this Padlet collection Examples of Signals and Systems. Examples of Signals and Systems QR Code

Can you add to it?

Concluding Example: Some Basic Signal Operations

Consider a signal

$$x = f(t) = \left\{ {\begin{array}{*{20}{c}} {0\;:\;t < - 1}\\ {t + 1\;:\; - 1 \le t \le 1}\\ {0\;:\;t > 1} \end{array}} \right.$$

Sketch this signal.













Problem

Think about the effect on this signal of applying the following basic signal operations:

  • $2 f(t)$
  • $0.5 f(t)$
  • $f(2t)$
  • $f(0.5 t)$
  • $-f(t)$
  • $f(-t)$
  • $-f(-t)$
  • $f(t - 1)$
  • $f(t + 1)$
  • $-2f(-t+2)$

We will work through these after the break together then you will do some exercises based on Chapter 1 of Karris.

Break