Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Magnitude Spectrum for square wave
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
-200 -150 -100 -50 0 50 100 150 200
Frequency f (Hz)
3. Spectrum Representation
1
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
What is Spectrum?
A graphical representation of the
frequency content of a signal
• Allow us to see interrelationships among the different
frequency components and their relative amplitudes
• Applications:
• Equalizer of Hi-Fi
• Allow key changing for Karaoke
• Enable speech recognition
• Determine a star is flying away or towards us (Doppler’s
effect)
2
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Spectrum of a Sum of Sinusoids
• Many signals are generated by adding together a constant
and N sinusoids, each with different frequency, amplitude
and phase
N
x(t ) = A0 + ∑ Ak cos(2πf k t + φk )
k =1
If N = 1,
x(t ) = A0 + A1 cos(2πf1t + φ1 )
If N = 2,
x(t ) = A0 + A1 cos(2πf1t + φ1 ) + A2 cos(2πf 2t + φ2 )
3
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
N
x(t ) = A0 + ∑ Ak cos(2πf k t + φk )
k =1
• Express in phasor form
{ }
N
x(t ) = X 0 + ∑ Re X k e j 2πf k t
k =1
Where
jφ k
X 0 = A0 , X k = Ak e
4
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
• For any complex number A= a + jb
Re{ A } = Re{ a + jb } = a = (a + jb + a – jb)/2
= (A + A*)/2
Where A* is the complex conjugate of A
Hence
{ }=
j 2πf k t * − j 2πf k t
j 2πf k t X ke + X ke
Re X k e
2
5
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
{
Re X k e j 2πf k t
}
= X ke
j 2πf k t
(
+ X ke )
j 2πf k t *
/2
(X ek
j 2πf k t *
) = (A e k )
j (2πf k t +φk ) *
= Ak cos(2πf k t + φk )
− jAk sin (2πf k t + φk )
− j (2πf k t +φk ) − jφk − j 2πf k t
= Ak e = Ak e e
* − j 2πf k t
6
= X ke
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
{ }
N
x(t ) = X 0 + ∑ Re X k e j 2πf k t
k =1
X k j 2πf t X k* − j 2πf t
N
⇒ x(t ) = X 0 + ∑ e k + e k
k =1 2 2
• We define the two-side spectrum (or spectrum) of
a signal to be the set of 2N+1 complex phasors X
and 2N+1 frequencies f
X1 X 1
* X2 X 2* XN X N*
( X 0 ,0 ), , f1 , ,− f1 , , f 2 , ,− f 2 L , f N , ,− f N
2 2 2
2 2
2
7
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Example
x(t ) = 10 + 14 cos(2π 100t − π / 3) + 8 cos(2π 250t + π / 2 )
− jπ / 3 j 2π 100t jπ / 3 − j 2π 100t
x(t ) = 10 + 7e e + 7e e
+ 4e jπ / 2e j 2π 250t + 4e − jπ / 2e − j 2π 250t
( )(
(10,0 ), 7e − jπ / 3 ,100 , 7e jπ / 3 ,−100 , )
4e (
jπ / 2
,250 , 4e )(
− jπ / 2
,−250
)
8
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Spectrum - A Graphical Plot of
Frequencies
10
7e jπ/3 7e -jπ/3
4e -jπ/2 4e jπ/2
-250 -100 0 100 250 f (in Hz)
DC
9
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Product of Signals
• In many practical systems, we intentionally
multiply two sinusoids to generate a signal
• Resulted audio signal is sometimes called beat note
• Examples:
• Musical Instruments
• Radio broadcasting – such as Amplitude
Modulation (AM)
Demo: Beatconb
10
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
How to Multiply Two Signals?
• It is easier to understand for multiplying a sinusoid
with a square wave
Switch
multiply
0
1
0 control
11
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Sinusoid A
transistor
multiply
control
Sinusoid B
• The amount of sinusoid A that can pass thru the
transistor is controlled by sinusoid B
12
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Spectrum of the Product of
Sinusoids
• To display the spectrum of the product of two
sinusoids, we need to convert it to a sum of
sinusoids first
• Because spectrum is defined in the form of sum of
sinusoids
• Inverse Euler’s formula
jθ − jθ jθ − jθ
e +e e −e
cos(θ ) = sin (θ ) =
13
2 2j
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
• For example
x(t ) = 2 cos(2π 20t ) cos(2π 200t )
x(t ) = 2 cos(2π 20t ) cos(2π 200t )
= cos(2π 220t ) + cos(2π 180t )
= 0.5 e( j 2π 220t
+e − j 2π 220t
)+ 0.5(e j 2π 180t
+e − j 2π 180t
)
0.5 0.5 0.5 0.5
14 -220 -180 0 180 220 f (in Hz)
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
• Spectrum above shows that we need not really
multiple the two 200Hz and 20Hz sinusoids,
• Can be done by a summation of 180Hz and 220Hz
sinusoids
• While the spectrum of every signal can be found, it
means that every signal can be constructed by
summing the required sinusoids
What are the required sinusoids of a signal?
Solution:
Solution: Fourier
Fourier Analysis
Analysis
15
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Fourier Series
• Fourier first shows that any periodic waveform
can be synthesized by a sum of sinusoids that are
harmonically related
Periodic
Periodic signal:
signal:
Signals
Signalsthat
thatrepeat
repeat
itself
itselfwithin
withinaafixed
fixed
period
period
16
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Harmonically
Harmonically related
related sinusoids:
sinusoids:
Sinusoids
Sinusoidswith
withfrequencies
frequenciesthat
thatare
aremultiple
multipleof
ofaafundamental
fundamental
frequency
frequency
fo = 100Hz (fundamental f = 300Hz = 3*fo (3rd harmonic)
frequency or 1st harmonic)
f = 200Hz = 2*fo (2nd harmonic) f = 500Hz = 5*fo (5th harmonic)
17
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
• Any continuous-time periodic waveform can be
represented by the Fourier series as follows:
∞
x(t ) = A0 + ∑ Ak cos(2πkf 0t + φk )
k =1 An infinite series
x(t ) = A0 + A1 cos(2πf 0t + φ1 ) + K + A∞ cos(2π∞f 0t + φ∞ )
{ }
∞
x(t ) = X 0 + ∑ Re X k e j 2πkfot
Where k =1
jφ k
X 0 = A0 , X k = Ak e
18
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
• {Xo, X1, X2, …, X∞} are the Fourier series
coefficients
• Each coefficient controls the amplitude of the
corresponding harmonic required to construct a
signal
• Some signals need less harmonics, some signals
need more
• For example, to 100% synthesize a square wave,
basically need ∞ number of harmonics
The fact is even if you have ∞ number of harmonics,
you still cannot obtain a 100% square wave. It is due to
the Gibbs phenomenon
19
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Gibbs
phenomenon
20
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Fourier Analysis
• For a given periodic signal, how do we know its
Fourier series coefficients?
• By Fourier series analysis
2 T0 − j 2πkt / T0
Xk =
T0 ∫0 x(t )e dt
Where
1
T0 = = fundamental period
f0
21
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Example
• Let’s determine the Fourier Series Coefficients of a
square wave
1 0 ≤ t < T0 / 2
x(t ) =
− 1 T0 / 2 ≤ t < T0
1
0
-1 t
T0
22
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
2 T0 − j 2πkt / T0
Xk =
T0 ∫0 x(t )e dt
2 T0 / 2 − j 2πkt / T0 2 T0
= ∫0 (1)e dt + ∫T / 2 (−1)e − j 2πkt / T0 dt
T0 T0 0
− j 2πkt / T0 T0 / 2 − j 2πk (T0 / 2 ) / T0 − j 2πk ( 0) / T0
2 e 2 e −e
=
T0 − j 2πk / T0 T0 − j 2πk / T0
0
e − jπk − 1
=
23 − jπk
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
− jπk − jπk − j 2πk
e −1 e −e
Xk = +
− jπk − jπk
=
2 − 2e − jπk
=
(
2 1 − (−1) k
)
jπk jπk
Since e-jπk = 1 if k
4 is even and = -1 if
jπk k = ±1,±3,±5,... k is odd
Xk =
0 k = 0,±2,±4,±6,...
24
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
4 j2π 25t 4 j2π 3*25t 4 j2π 5*25t 4 j2π 7*25t
x(t) = Re e + e + e + e
jπ jπ 3 jπ 5 jπ 7
1 − jπ / 2
Since = e , hence
j
4 − jπ / 2 j2π 25t 4 − jπ / 2 j2π 3*25t
π e e + e e
x(t) = Re
π 3
4 − jπ / 2 j2π 5*25t 4 − jπ / 2 j2π 7*25t
+ e e + e e
π5 π7
25
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
If we are only interested in the magnitude of each coefficient,
we have
4 − jπ / 2 4 4
e = (cos(π / 2)) + (− sin (π / 2)) =
2 2
πk πk πk
Magnitude Spectrum for square wave
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
-200 -150 -100 -50 0 50 100 150 200
26 Frequency f (Hz)
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Exercise 2
• Let’s determine the Fourier Series Coefficients of a
sawtooth wave
Hint:
T0
x(t ) = − t 0 ≤ t < T0 te at
e at
2 ∫ dt = a − a 2
te at
T0/2
-T0/2
T0
27
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
Solution to Exercise 2
T0
(
X 0 = ∫ (T0 / 2 − t )dt = (T0 / 2)t − t / 2
0
2
)T0
0
=0
T0
X k = ∫ (T0 / 2 − t )e − j 2πkt / T0 dt
0
T0
− j 2πkt / T0 − j 2πkt / T0
2 te e
=− +
T0 − j 2πk / T0 (2πk / T0 ) 2
0
T0 T0 − jπ / 2
= = e
28 jπk πk
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
3. Spectrum Representation
T0 j2πt /T0 T0 j2π 2t /T0 T0 j2π 3t /T0
x(t) = Re e + e + e +...
jπ jπ 2 jπ3
Assume f = 1/T0 = 25
Magnitude Spectrum for square wave
0.014
0.012
0.01
Amplitude
0.008
0.006
0.004
0.002
0
-150 -100 -50 0 50 100 150
29 Frequency f (Hz)