An Introduction to Signals

What is a Signal?

A signal is a set of data or information. In general, signals are functions of the independent variable time. This is not always the case, however. When an electrical charge is distributed over a body, for instance, the signal is the charge density, a function of space rather than time. The term "signal" includes, among others, audio, video, speech, image, communication, geophysical, sonar, radar, medical and musical signals.

Some examples of signals are: a telephone or a television signal, monthly sales of a corporation, or daily closing prices of a stock market (e.g., the Dow Jones averages), a sinusoidal voltage source (the AC voltage outlets), a sound wave being produced when you pluck a guitar string, your heart rate (plotted on an electrocardiogram), temperature in a room throughout the day, and more.

In the real world, signals are not always regular and periodic like a sine or cosine wave for example. They can be very complicated, aperiodic and irregular (think of an electrocardiogram). Below is a sine wave that could represent a voltage source to a circuit. Click to change to a non-periodic signal:


Here are some questions we can answer with Signals and Systems:

  • Analyze Signals: What information is in this signal? Is there some unexpected signal content (corruption or noise)? Could there be hidden information in this signal?
  • Design Systems: How do i design this circuit to do what I want? Can I be confident that it will produce the expected or desired output before construction, i.e. has or meets some performance criteria?
  • Filter Signals: Can I remove some information I am interested in (decode)? Can I reduce the impact of corruption or noise? Can I add information to the signal (encode)?
  • Control: Can I make sure this mechanical system, perhaps part of a robot, performs within some bounds of stability?
  • Modeling: Can I model some real system (ecological, biological, physical) as a linear system so as to study its behavior and possibly control it?


Sinusoidal Signals

Periodic signals are those signals that repeat in time with a certain period. Sinusoidal signals are very important because (as we will see below) they can be used to represent any periodic signal. Sinusoidal signals have 3 parameters: amplitude, frequency and phase. The amplitude determines the highest value the signal reaches. The frequency determines how often a signal goes through a cycle (repeats). The phase of a signal determines where the signal starts compared to its "parent function". For example, determine the amplitude, frequency and phase of the following signal which is a function of time:

$$x(t) = 3sin(4\pi t+30 \,^{\circ}) $$

                            (click to check answers)

                                       


To visualize signals better and understand how the parameters mentioned above shape the signal, let's try the following example. Manipulate the frequency and amplitude of the sine wave to see what happens to it:

Signal Transformations

As you see in the above example, changing the signal's frequency or amplitude changes it's behaviour and shape. We can say the signal has been "transformed" from a primitive (sine) signal to a more complex one. The main transformations of time that we can perform on signals are:

  • Time Shifting: $$x(t) \rightarrow x(t-\tau) \hspace{1 pc} \begin{Bmatrix} \tau > 0, \hspace{1 pt} delay& \\ \tau < 0, \hspace{1 pt} advance& \end{Bmatrix}$$

For example, let's say: $$x(t) = cos(t - \tau)$$ How will changing Tau affect x(t)? Change Tau below to see the effect:

  • Time Scaling: $$x(t) \rightarrow x(\frac{t}{\tau})$$

For positive values of Tau, increasing Tau expands the signal in time. For negative Tau, the signal time-reverses and decreasing Tau expands the signal in time. The above example where you could change the frequency gives you an idea of the effect in this case. However, below is an example of time reversal that happens when Tao becomes negative:

$$\tau = 1 \Rightarrow x(t) = at^3+bt^2+ct+d $$ $$ \tau = -1 \Rightarrow x(-t) = a(-t)^3+b(-t)^2+c(-t)+d $$


Signal Energy

Signals, as you saw above, can have positive or negative values for different time intervals. If we considered a signal's area as a positive measure of its size, because it takes into account both the amplitude and duration of the signal, we will soon run into a problem. The positive and negative areas could cancel each other and result in an inaccurate size. This difficulty can be corrected by defining the signal size as the area under x2(t), which is always positive. We call this measure the signal energy Ex: $$E_{x} = \int_{-\infty}^{\infty}|x(t)|^{2}dt$$

Let's take for example a simple signal such as x(t) = sin(t) from 0 to t. To find its Energy, we first need to square the signal to get x2(t) = sin2(t). Below is a graphical representation of this squared signal sin2(t). Hover over the graph to see the area from 0 to that point which will indicate the energy. Notice how the energy increases as t increases:


Fourier Series

A Fourier series is a way to represent a wave-like function as the sum of simple sine waves. More formally, it decomposes any periodic function or periodic signal into the sum of a (possibly infinite) set of simple oscillating functions, namely sines and cosines (or, equivalently, complex exponentials).

Let's consider a signal x(t) made up of sines and cosines of frequency ω0(the fundamental frequency) and all of its harmonics (including the zeroth harmonic; i.e., dc) with arbitrary amplitudes: $$x(t) = a_{0} + \sum_{n=1}^{\infty}a_ncos(n\omega_0t)+b_nsin(n\omega_0t)$$ The infinite series on the right-hand side is known as the trigonometric Fourier series of a periodic signal x(t). All we need to do to find the Fourier Series of a periodic signal is to compute the coefficients a0, an and bn. The more terms we use, the better the approximation. Here are the formulas for a0, an and bn: $$a_0 = \frac{1}{T_0}\int_{T_0} x(t)dt \hspace{1 in} T_0 = \frac{2\pi}{\omega_0}$$ $$a_n = \frac{2}{T_0}\int_{T_0} x(t)cos(n\omega_0t)dt \hspace{1 in} b_n = \frac{2}{T_0}\int_{T_0} x(t)sin(n\omega_0t)dt $$
For example, let's consider the square wave defined as: $$x(t+2\pi) = x(t) = \left\{\begin{matrix} 0 \hspace{1 cm} -\pi \leq t < 0 & \\ 1 \hspace{1 cm} 0 \leq t < \pi & \end{matrix}\right.$$

Image from: http://www.stewartcalculus.com/

Then we can easily calculate a0, an and bn by using the formulas above: $$a_0 = \frac{1}{2\pi}\int_{-\pi}^{\pi}x(t)dt= \frac{1}{2} \hspace{0.8 in} a_n = \frac{1}{\pi}\int_{-\pi}^{\pi}x(t)cos(nt)dt= \frac{1}{n\pi}[sin(n\pi)-sin(0)]=0$$ $$b_n = \frac{1}{\pi}\int_{-\pi}^{\pi}x(t)sin(nt)dt=\frac{1}{\pi}\int_{-\pi}^{0}0\,dt + \frac{1}{\pi}\int_{0}^{\pi}sin(t)\,dt = \left\{\begin{matrix} 0 \hspace{1 cm} if \,\,n \,\,is\,\,even& \\ \frac{2}{n\pi} \hspace{1 cm} if \,\,n \,\,is\,\,odd& \end{matrix}\right.$$


Approximating a Square Wave using a Fourier Series:

Using the same method as in the exercise above, we can derive this formula to approximate a square wave: $$x_{square}(t) = \frac{4}{\pi} \sum_{k=1}^{\infty} (-1)^k \frac{sin(2\pi(2k-1)ft)}{2k-1}$$ To give a better idea of how the Fourier Series works visually, consider the following example (note: this square wave oscillates about the x-axis):

Approximating a Triangle Wave using a Fourier Series: Here is the formula for approximating a triangle wave. This formula can be derived using the above exercise.

$$x_{triangle}(t) = \frac{8}{\pi^2} \sum_{k=0}^{\infty} (-1)^k \frac{sin(2\pi(2k+1)ft)}{(2k+1)^2}$$

Approximating a Sawtooth Wave using a Fourier Series: Here is the formula for approximating a sawtooth wave:

$$x_{sawtooth}(t) = \frac{2}{\pi} \sum_{k=1}^{\infty} (-1)^k \frac{sin(2\pi kft)}{k}$$

Signal Sampling

This is as input signal from a voltage source. In this case the input is a sine wave with an amplitude of 3 and a period of 2 π. This is an example of a continuous time signal.
This is the same input signal now plotted as a discrete set of data points. Only 50 points of the signal are plotted here. Note that the x-axis is not time in seconds anymore but it is the number of data points plotted.

Here is an example of a sine wave sampled every 0.5 seconds. It is clear that as the sampling frequency goes to infinity, we get an exact reconstruction of our original sine wave.

Copyright © IOLA and Ole Laursen


References