You are on page 1of 32

Instrumentation & Control

Lecture 2
Signals and Fourier Transform
Instructor: Dr. Waqar Ahmed
Mechanical Engineering Department
University of Engineering & Technology, Taxila
waqaraq@gmail.com
1. Signal
• A measurement system takes an input quantity and transforms it into
output that can be observed
• Input Signals
• Output Signals
• Signal consists of following components
• Magnitude and Amplitude
• Frequency
2. Types of Signals
• Analog
• Discrete
• Digital
* Mostly people find it difficult to grasp the difference between
Discrete and Digital signal. Hence, here it is explained:

“A discrete signal is quantized only in time whereas a digital signal is


quantized in both time and amplitude”.
Analog, Discrete and Digital Signal Example
Analog Signal Discrete Signal Digital Signal
5 5 5

Amplitude
Amplitude

Amplitude
2.5 2.5 2.5

0 0 0
0 2.5 5 7.5 10 0 2.5 5 7.5 10 0 2.5 5 7.5 10
Time Time Time
Signal Waveforms
• Static
• Dynamic
• Periodic
• Simple Periodic
• Complex Periodic
• Aperiodic
• Step
• Ramp
• Pulse
• Non Deterministic
Static
Static Signal
5

Amplitude
3

0
0 1 2 3 4 5 6 7 8 9 10
Time
Periodic
Periodic Simple Sine Periodic Simple Cosine Complex Periodic Sin + Cos
2 2 2

1 1 1
Amplitude

Amplitude

Amplitude
0 0 0

-1 -1 -1

-2 -2 -2
0 90 180 270 360 0 90 180 270 360 0 90 180 270 360
Time Time Time
Aperiodic
Step Ramp Pulse
2 5 5
4 4
Amplitude

Amplitude

Amplitude
3 3
1
2 2
1 1
0 0 0
0 90 180 270 360 0 90 180 270 360 0 90 180 270 360
Time Time Time
Non deterministic
Non-deterministic
12

Amplitude 8

0
0 90 180 270 360
Time
Signal Analysis
•  Mean Value of the Signal  • Root Mean Square Value
• For Analog Signal of the Signal
• For Analog Signal

• For Digital Signal


• For Digital Signal
Direct Current Offset
Original Signal DC Offset
Result
4 24
24
2.5 18
18

Amplitude
Amplitude
Amplitude

12
12 = 1
+
-0.5 6
6
-2 0
0 0 90 180 270 360 0 90 180 270 360
0 90 180 270 360
Time Time
Time
What is frequency domain? Why use it?
• Example of Prism
What is frequency domain? Why use it?
• What is your favorite dish?
• What do you do to cook something?
• Add salt, pepper, oil, vegetable, meat, etc.
• The process of finding the ingredients of your favorite dish is
analogous to frequency domain analysis
How can signals be separated?
• The answer is Fourier Transform
• We will learn how to use it simply as a tool and how to get an intuitive
feel of the concept

Example of LABVIEW Code


• We will switch to a simulation developed in LABVIEW to understand
how different signals combine and can be separated
Formulation
•  There is a formula called Euler’s formula.
Some Boring Derivations
𝑖𝜋
𝑒 =−1
 

Real Imaginary
1
1 0
0
0 1
0
-1 1
0
-1
0 -1
0
1
0 0
-1
0 1
1 0
0 1
 Nature of complex exponential
Real (Cos) Imaginary (Sin)
1

-1
0 1 2 3 4 5 6 7 8
An important statement
•  The term basically represents a sine and a cosine signal
• The real part represents cosine and the imaginary part represents
sine
Fourier Transform
• Fourier transform can be used for both discrete as well as continuous
signals
• In this course, we are primarily concerned about using Fourier
Transform for discrete / digital signals which is called as Discrete
Fourier Transform (DFT)
• Formula for DFT is given as
  𝑁 −1
−𝑖 2 𝜋𝜔𝑛 / 𝑁
𝑋 ( 𝜔 )= ∑ 𝑥 𝑛 𝑒
𝑛=0
Understanding the Fourier Transform
• 
Why multiplication of signals is useful?
•Consider
  a simple expression

+ve +ve +ve Big +ve


+ve
-ve +ve
-ve +ve
+ve Big
Big +ve
+ve
-ve
+ve -ve +ve
-ve Big +ve
‘Big’ -ve
+ve
-ve +ve
-ve -ve ‘Big’ -ve
+ve-ve
/ -ve -ve+ve
/ +ve +ve-ve
/ -ve Small +ve-ve
‘Big’ / -ve
+ve / -ve -ve / +ve +ve / -ve
Summary of Discussion
•  represents a sine and a cosine signal
• If

It means the complex signal has a frequency close to the frequency of


the simple periodic signal
• It could be an analogy with a resonating frequency
• The term ‘’ represents a complete cycle
  𝑁 −1
−𝑖 2 𝜋𝜔𝑛 / 𝑁
Implementation of DFT 𝑋 ( 𝜔 )= ∑ 𝑥 𝑛 𝑒
𝑛=0
Signal Complex Signal
3 18

9
9 12
17
17
13 6
13
15
15
10 0
1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6
10
  𝑁 −1
−𝑖 𝜋𝜔 2𝑛 / 𝑁
Implementation of DFT 𝑋 ( 𝜔 )= ∑ 𝑥 𝑛 𝑒
𝑛=0
  6−1
−𝑖 𝜋𝜔2 𝑛 /6
𝑋 ( 𝜔 )=∑ 𝑥 𝑛 𝑒 𝑖𝜃
𝑒 =cos 𝜃+𝑖 sin 𝜃
 

𝑛 =0
  5
−𝑖 𝜋 𝜔 𝑛 /3
𝑋 ( 𝜔 )=∑ 𝑥 𝑛 𝑒
𝑛 =0
Twiddle Matrix
• It may be seen from even so simple example that the process of
evaluating Fourier Transform becomes very cumbersome
• Hence, it makes sense to express it in another notation (for example
Matrix) to make calculations convenient
• Twiddle matrix is one such way to ease the process
• To do so, we will need to generalize the formulation a bit
  2𝑖 𝜋𝜔 4 𝑖 𝜔𝜋 2 ( 𝑁 −1) 𝑖 𝜔𝜋
− − −
0 𝑁 𝑁 𝑁
𝑋 ( 𝜔 )= 𝑥 0 𝑒 + 𝑥 1 𝑒 + 𝑥2 𝑒 … 𝑥 𝑛 −1 𝑒
  𝑁 −1
−𝑖 𝜋𝜔 2𝑛 / 𝑁
 
Now generalizing it in terms of as well 𝑋 ( 𝜔 )= ∑ 𝑥 𝑛 𝑒
𝑛=0
  𝑋 ( 0 ) =𝑥0 𝑒 0 + 𝑥 1 𝑒 0 + 𝑥2 𝑒 0 … 𝑥 𝑁 −1 𝑒 0
  2𝑖 𝜋 4𝑖 𝜋 2 ( 𝑁 − 1) 𝑖 𝜋   Using:
− − −
0 𝑁 𝑁 𝑁
𝑋 ( 1 )=𝑥 0 𝑒 + 𝑥 1 𝑒 + 𝑥2𝑒 … 𝑥𝑁 − 1 𝑒
  4𝑖𝜋 8𝑖𝜋 4 ( 𝑁 − 1) 𝑖 𝜋
− − −
0 𝑁 𝑁 𝑁
𝑋 ( 2 )= 𝑥 0 𝑒 + 𝑥1 𝑒 + 𝑥2 𝑒 … 𝑥 𝑁 −1 𝑒

2
  2 (𝑁 −1) 𝑖 𝜋 4 (𝑁 − 1)𝑖 𝜋 2 ( 𝑁 −1 ) 𝑖 𝜋
− − −
0 𝑁 𝑁 𝑁
𝑋 𝑁 −1 = 𝑥 0 𝑒 + 𝑥 1 𝑒
( ) + 𝑥2 𝑒 … 𝑥 𝑁 −1 𝑒
 𝑋 ( 0 ) =𝑥0 𝑒 0 + 𝑥 1 𝑒 0 + 𝑥2 𝑒 0 … 𝑥 𝑁 −1 𝑒 0
 𝑋 ( 1 ) =𝑥 𝑒 0+ 𝑥 𝑣 + 𝑥 𝑣2 … 𝑥 𝑣 ( 𝑁 −1)
0 1 2 𝑁 −1
 𝑋 ( 2 ) =𝑥 𝑒 0 + 𝑥 𝑣 2 + 𝑥 𝑣 4 … 𝑥 2 (𝑁 − 1)
0 1 2 𝑁 −1 𝑣

2
0 (𝑁 −1) 2 (𝑁 − 1) ( 𝑁 − 1)
𝑋 ( 𝑁 −1 ) =𝑥 0 𝑒 + 𝑥 1 𝑣
 
+ 𝑥2 𝑣 … 𝑥 𝑁 −1 𝑣

 
𝑿 (𝟎) 𝟏 𝟏 𝟏 … 𝟏 𝒙𝟎

[ ][ ][ ]
𝟐 ( 𝑵 −𝟏)
𝑿 (𝟏) 𝟏 𝒗 𝒗 … 𝒗 𝒙𝟏
𝑿 (𝟐) 𝟏 𝒗𝟐 𝒗
𝟒
… 𝒗
𝟐( 𝑵 −𝟏)
𝒙𝟐
⋮ = ⋮ ⋮ ⋮ … ⋮ ⋮
⋮ ⋮ ⋮ ⋮ … ⋮ ⋮
⋮ ⋮ ⋮ ⋮ … ⋮ ⋮
𝟏 𝑵 −𝟏

𝟐
𝟐( 𝑵 −𝟏) ( 𝑵 − 𝟏)
𝑿 ( 𝑵 − 𝟏) 𝒗 𝒗 𝒗 𝒙𝑵 − 𝟏
Example
t 0 1 2 3 4 5
x 14 12 17 1 78 34

 
,
 

0 0 0 0 0 0
𝑣 𝑣 𝑣 𝑣 𝑣 𝑣

[ ]
0 1 2 3 4 5
𝑣 𝑣 𝑣 𝑣 𝑣 𝑣
0 2 4 6 8 10
𝑣 𝑣 𝑣 𝑣 𝑣 𝑣
𝑉 = 0 3 6 9 12 15
𝑣 𝑣 𝑣 𝑣 𝑣 𝑣
0 4 8 12 16 20
𝑣 𝑣 𝑣 𝑣 𝑣 𝑣
0 5 10 15 20 25
𝑣 𝑣 𝑣 𝑣 𝑣 𝑣
Example (Contd) Evaluate the matrix V
Final Touches
•  Identify the component with highest amplitude and respective
frequency (Only first half)
• Find the magnitude =
• Double the magnitude because we dropped 2nd half of result
• Divide the resulting magnitude by N (number of samples) and that
will be the share of that particular frequency in the signal

You might also like