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.
These will be illustrated with computation in Wolfram|Alpha, Matlab, Simulink.
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 |
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)$$
Here's the link: http://www.wolframalpha.com
Paste this into the search box
plot 3 cos(2 pi 2 t - 3 pi/4)
In Matlab we would need to tackle this by breaking down the steps.
Define t
t = linspace(0, 1, 100);
Define x
x = 3 * cos(2*pi*2*t - 3*pi/4);
Plot result and label plot
plot(t,x)
title('A Sinusoidal Signal')
xlabel('Time t (s)')
ylabel('Amplitude')
grid
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 |
What is the period of the waveform in seconds?
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)\}.$$
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.
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.
open gain_level_shift
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.
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
open y
%% 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
%% 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
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.
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
open discrete_system
Signals that repeat over and over are said to be periodic. In mathematical terms, a signal is periodic if:
The smallest $T$ or $N$ for which the equality holds is the signal period.
%% A Periodic signal (square wave)
t = linspace(0, 1, 500);
x = square(2 * pi * 5 * t);
plot(t, x);
ylim([-2, 2]);
grid()
title('A Periodic Signal')
xlabel('Time t (s)')
ylabel('Amplitude')
$T = $?
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?
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
%% An aperiodic function
tau = 1;
x = linspace(-1,5,1000);
y = rectangularPulse(0,tau,x);
plot(x,y)
ylim([-0.2,1.2])
grid
title('An Aperiodic Signal')
xlabel('Time t (s)')
ylabel('Amplitude')
%% 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')
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.
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?
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?
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}$$
two_sines
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.
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.
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.
I used the examples from Signals and Systems for Dummies to seed this Padlet collection Examples of Signals and Systems.
Can you add to it?
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.
Think about the effect on this signal of applying the following basic signal operations:
We will work through these after the break together then you will do some exercises based on Chapter 1 of Karris.