Circuits and Systems I LECTURE 3 The Spectrum, Periodic Signals, and the TimeVarying Spectrum Prof. Dr. Volkan Cevher lionsepfl LIONSLaboratory for Information and Inference SystemsLicense Info for SPFirst Slides • This work released under a Creative Commons License with the following terms: • Attribution § The licensor permits others to copy, distribute, display, and perform the work. In return, licensees must give the original authors credit. • NonCommercial § The licensor permits others to copy, distribute, display, and perform the work. In return, licensees may not use the work for commercial purposes—unless they get the licensors permission. • Share Alike § The licensor permits others to distribute derivative works only under a license identical to the one that governs the licensors work. • Full Text of the License • This (hidden) page should be kept with the presentationOutline Today • Today Section 31 – 33 Section 37 Section 38 Next week Section 34 Section 35 Section 36 Lab 2 CSI Progress Level: READLecture Objectives • Sinusoids with DIFFERENT frequencies – SYNTHESIZE by Adding Sinusoids • SPECTRUM Representation – Graphical Form shows DIFFERENT Freqs ∑= = + + N k x t A Ak fkt k 1 ( ) 0 cos(2π ϕ ) CSI Progress Level:FREQUENCY DIAGRAM Frequency is the vertical axis Time is the horizontal axis A440Another FREQ. Diagram • Plot Complex Amplitude vs. Freq –250 –100 0 100 250 f (in Hz) 3 7e jπ 7e− jπ 3 2 4e− jπ 4e jπ 2 10 ∑= = + + N k x t A Ak fkt k 1 ( ) 0 cos(2π ϕ )Motivation • Synthesize Complicated Signals – Musical Notes § Piano uses 3 strings for many notes § Chords: play several notes simultaneously – Human Speech § Vowels have dominant frequencies § Application: computer generated speech – Can all signals be generated this way? § Sum of sinusoids?Fur Elise WAVEFORM Beat NotesSpeech Signal: BAT • Nearly Periodic in Vowel Region – Period is (Approximately) T = 0.0065 secEuler’s Formula Reversed • Solve for cosine (or sine) e jωt = cos(ωt) + j sin(ωt) e− jωt = cos(−ωt) + jsin(−ωt) e− jωt = cos(ωt) − j sin(ωt) e jωt + e− jωt = 2cos(ωt) cos(ωt) = 12 (e jωt + e− jωt)INVERSE Euler’s Formula • Solve for cosine (or sine) cos(ωt) = 12 (e jωt + e− jωt) sin(ωt) = 21j (e jωt − e− jωt)SPECTRUM Interpretation • Cosine = sum of 2 complex exponentials: One has a positive frequency The other has negative freq. Amplitude of each is half as big A j t A j t A t e e 7 2 7 cos(7 ) = 2 + −SPECTRUM of SINE • Sine = sum of 2 complex exponentials: – Positive freq. has phase = 0.5π – Negative freq. has phase = +0.5π j j t j j t j t Aj j t Aj Ae e Ae e A t e e 0.5 7 12 0.5 7 12 7 2 7 sin(7 ) 2 − − − = + = − π π 1 j0.5π −j = j = eNegative Frequency • Is negative frequency real? • Doppler Radar provides an example – Police radar measures speed by using the Doppler shift principle – Let’s assume 400Hz ßà60 mph – +400Hz means towards the radar – 400Hz means away (opposite direction) – Think of a train whistleGraphical Spectrum EXAMPLE of SINE AMPLITUDE, PHASE FREQUENCY are shown 7 0 7 ω j j t j j t A t Ae e Ae 0.5 e 7 12 0.5 7 12 sin(7 ) = − π + π − 0.5π 12 ( A)e j (12 A)e− j0.5πSPECTRUM2SINUSOID • Add the spectrum components: What is the formula for the signal x(t)? –250 –100 0 100 250 f (in Hz) 3 7e jπ 7e− jπ 3 2 4e− jπ 4e jπ 2 10Gather (A,ω,φ) information • Frequencies: – 250 Hz – 100 Hz – 0 Hz – 100 Hz – 250 Hz • Amplitude Phase – 4 π2 – 7 +π3 – 10 0 – 7 π3 – 4 +π2 DC is another name for zerofreq component DC component always has φ=0 or π (for real x(t) ) Note the conjugate phaseAdd Spectrum Components1 • Amplitude Phase – 4 π2 – 7 +π3 – 10 0 – 7 π3 – 4 +π2 • Frequencies: – 250 Hz – 100 Hz – 0 Hz – 100 Hz – 250 Hz j j t j j t j j t j j t e e e e e e e e x t 2 2 (250) 2 2 (250) 3 2 (100) 3 2 (100) 4 4 7 7 ( ) 10 π π π π π π π π − − − − + + = +Add Spectrum Components2 j j t j j t j j t j j t e e e e e e e e x t 2 2 (250) 2 2 (250) 3 2 (100) 3 2 (100) 4 4 7 7 ( ) 10 π π π π π π π π − − − − + + = + –250 –100 0 100 250 f (in Hz) 3 7e jπ 7e− jπ 3 2 4e− jπ 4e jπ 2 10Use Euler’s Formula to get REAL sinusoids: Simplify Components j j t j j t j j t j j t e e e e e e e e x t 2 2 (250) 2 2 (250) 3 2 (100) 3 2 (100) 4 4 7 7 ( ) 10 π π π π π π π π − − − − + + = + j j t j j t Acos(ωt +ϕ) = 12 Ae+ ϕe ω + 12 Ae− ϕe− ωFinal Answer So, we get the general form: ∑= = + + N k x t A Ak fkt k 1 ( ) 0 cos(2π ϕ ) 8cos(2 (250) 2) ( ) 10 14 cos(2 (100) 3) π π π π + + = + − tt x tSummary: General Form ∗ ℜe z = z + z 12 12 { } k j k k f X A e k = = Frequency ∑ { } ϕ = = + ℜ N k j f t k x t X e X e k 1 2 ( ) 0 π ∑{ } = ∗ − = + + N k j f t k j f t k x t X X e k X e k 1 2 12 2 12 ( ) 0 π π ∑= = + + N k x t A Ak fkt k 1 ( ) 0 cos(2π ϕ )Example: Synthetic Vowel • Sum of 5 Frequency ComponentsSPECTRUM of VOWEL – Note: Spectrum has 0.5Xk (except XDC) – Conjugates in negative frequencySPECTRUM of VOWEL (Polar Format) φk 0.5A kVowel Waveform (sum of all 5 components)Problem Solving Skills • Math Formula – Sum of Cosines – Amp, Freq, Phase • Recorded Signals – Speech – Music – No simple formula • Plot Sketches – S(t) versus t – Spectrum • MATLAB – Numerical – Computation – Plotting list of numbersLecture Objectives • Signals with HARMONIC Frequencies – Add Sinusoids with fk = kf0 FREQUENCY can change vs. TIME Chirps: Introduce Spectrogram Visualization (specgram.m) (plotspec.m) x(t)= cos(αt2) ∑= = + + N k x t A Ak kf t k 1 ( ) 0 cos(2π 0 ϕ )Spectrum Diagram • Recall Complex Amplitude vs. Freq 12 Xk = ak –250 –100 0 100 250 f (in Hz) 3 7e jπ 7e− jπ 3 2 4e− jπ 4e jπ 2 10 8cos(2 (250) 2) ( ) 10 14 cos(2 (100) 3) π π π π + + = + − tt x t j k Xk = Ake ϕ ∗k X 12Spectrum for Periodic Signals? • Nearly Periodic in the Vowel Region – Period is (Approximately) T = 0.0065 secPeriodic Signals • Repeat every T secs – Definition – Example: – Speech can be “quasiperiodic” x(t) = x(t + T) x(t) = cos2(3t) T = ? π3 T = 3 2π T =Period of Complex Exponentials Definition: Period is T k = integer j t T j t e e ω ω = ( + ) ( ) ( ) ? ( ) x t T x t x t e j t + = = ω e j2πk = 1 ⇒ e jωT =1 ⇒ωT = 2πk k k T T k 0 2 2 ω π π ω = ⎞⎟⎠ ⎛⎜⎝ = =∑{ } ∑ = ∗ − = = + + = = + + N k j kf t k j kf t k j k k N k k k x t X X e X e X A e x t A A kf t k 1 2 12 2 12 0 1 0 0 ( ) 0 0 ( ) cos(2 ) π π ϕ π ϕ Harmonic Signal Spectrum Periodic signal can only have : fk = k f0 T f0 = 1Define Fundamental Frequency 0 0 1T f = fundamental Period (shortest) fundamental Frequency (largest) ( 2 ) ( ) cos(2 ) 0 0 0 0 0 1 0 0 = = = = = +∑ + = f T f k f f x t A A kf t k N k k k ω π π ϕWhat is the fundamental frequency? Harmonic Signal (3 Freqs) 3rd 5th 10 HzPOP QUIZ: Fundamental Freq. • Here’s another spectrum: What is the fundamental frequency? 100 Hz ? 50 Hz ? –250 –100 0 100 250 f (in Hz) 3 7e jπ 7e− jπ 3 2 4e− jπ 4e jπ 2 10SPECIAL RELATIONSHIP to get a PERIODIC SIGNAL IRRATIONAL SPECTRUMHarmonic Signal (3 Freqs) T=0.1NONHarmonic Signal NOT PERIODICFrequency Analysis • Now, a much HARDER problem • Given a recording of a song, have the computer write the music § Can a machine extract frequencies? § Yes, if we COMPUTE the spectrum for x(t) § During short intervalsTimeVarying FREQUENCIES Diagram Frequency is the vertical axis Time is the horizontal axis A440A Simple Test Signal • Cmajor SCALE: stepped frequencies – Frequency is constant for each note IDEALRrated: ADULTS ONLY • SPECTROGRAM Tool – MATLAB function is specgram.m – SPFirst has plotspec.m spectgr.m • ANALYSIS program – Takes x(t) as input – Produces spectrum values Xk – Breaks x(t) into SHORT TIME SEGMENTS § Then uses the FFT (Fast Fourier Transform)Rrated: ADULTS ONLY • SPECTROGRAM Tool – MATLAB function is specgram.m – SPFirst has plotspec.m spectgr.m • ANALYSIS program – Takes x(t) as input – Produces spectrum values Xk – Breaks x(t) into SHORT TIME SEGMENTS § Then uses the FFT (Fast Fourier Transform) CSI Progress Level:Spectrogram Example • Two Constant Frequencies: Beats cos(2π (660)t)sin(2π (12)t)12 (e j2π (660)t + e− j2π (660)t )21j (e j2π (12)t − e− j2π (12)t ) AM Radio Signal • Same as BEAT Notes cos(2π (660)t)sin(2π (12)t) 12 cos(2π(672)t − π2 ) + 12 cos(2π(648)t + π2 ) 41j (e j2π (672)t − e− j2π (672)t − e j2π (648)t + e− j2π (648)t)Spectrum of AM (Beat) • 4 complex exponentials in AM: What is the fundamental frequency? 648 Hz ? 24 Hz ? 0 648 672 –672 –648 f (in Hz) 2 14 jπ e 2 14 jπ e 2 − 14 jπ e 2 − 14 jπ eStepped Frequencies • Cmajor SCALE: successive sinusoids – Frequency is constant for each note IDEALSpectrogram of CScale ARTIFACTS at Transitions Sinusoids ONLY From SPECGRAM ANALYSIS PROGRAMSpectrogram of LAB SONG ARTIFACTS at Transitions Sinusoids ONLY Analysis Frame = 40msTimeVarying Frequency • Frequency can change vs. time – Continuously, not stepped • FREQUENCY MODULATION (FM) • CHIRP SIGNALS – Linear Frequency Modulation (LFM) x(t) = cos(2π fct + v(t)) VOICEx(t) = Acos(αt2 + 2π f0t +ϕ) New Signal: Linear FM • Called Chirp Signals (LFM) – Quadratic phase • Freq will change LINEARLY vs. time – Example of Frequency Modulation (FM) – Define “instantaneous frequency” QUADRATICInstantaneous Frequency • Definition • For Sinusoid: Derivative ( ) ( ) of the “Angle” ( ) cos( ( )) t t x t A t dt d ωi ψ ψ ⇒ = = Makes sense 0 0 0 ( ) ( ) 2 ( ) 2 ( ) cos(2 ) t t f t f t x t A f t dt d ωi ψ π ψ π ϕ π ϕ ⇒ = = = + = +Instantaneous Frequency of the Chirp • Chirp Signals have Quadratic phase • Freq will change LINEARLY vs. time ψ α β ϕ α β ϕ ⇒ = + + = + + t t t x t A t t 2 2 ( ) ( ) cos( ) ⇒ωi(t) = ddtψ(t) = 2αt + βChirp SpectrogramChirp WaveformOTHER CHIRPS • ψ(t) can be anything: • ψ(t) could be speech or music: – FM radio broadcast x(t) = Acos(α cos(βt) +ϕ) ⇒ωi(t) = dt d ψ(t) = −αβsin(βt)SineWave Frequency Modulation (FM) Look at CDROM Demos in Ch 3• Next week Section 34 Section 35 Section 36 Lab 2
Trang 1Circuits and Systems I
LECTURE #3 The Spectrum, Periodic Signals, and the Time-Varying Spectrum
Prof Dr Volkan Cevher
LIONS/ Laboratory for Information and Inference Systems lions @epfl
Trang 2License Info for SPFirst Slides
• This work released under a
Creative Commons License with the following
• Share Alike
§ The licensor permits others to distribute derivative works only under
a license identical to the one that governs the licensor's work
• Full Text of the License
• This (hidden) page should be kept with the presentation
Trang 4Lecture Objectives
• Sinusoids with DIFFERENT frequencies
– SYNTHESIZE by Adding Sinusoids
=
N
k
k k
k f t A
A t
Trang 6Another FREQ Diagram
• Plot Complex Amplitude vs Freq
–100 –250
f (in Hz)
3 /
7 e j π 7 e − j π / 3
2 /
=
N
k
k k
k f t A
A t
Trang 7Motivation
• Synthesize Complicated Signals
– Musical Notes
§ Piano uses 3 strings for many notes
§ Chords: play several notes simultaneously – Human Speech
§ Vowels have dominant frequencies
§ Application: computer generated speech
§ Sum of sinusoids?
Trang 8Fur Elise WAVEFORM
Beat Notes
Trang 9Speech Signal: BAT
• Nearly Periodic in Vowel Region
– Period is (Approximately) T = 0.0065 sec
Trang 10Euler’s Formula Reversed
• Solve for cosine (or sine)
) sin(
) cos( t j t
) sin(
)
e − j ω t = − ω + − ω
) sin(
) cos( t j t
e − j ω t = ω − ω
) cos(
e
e j ω t + − j ω t = ω
) (
) cos( ω t = 2 1 e j ω t + e − j ω t
Trang 11INVERSE Euler’s Formula
• Solve for cosine (or sine)
) (
) cos( ω t = 1 2 e j ω t + e − j ω t
) (
) sin( ω t = 2 1 j e j ω t − e − j ω t
Trang 12SPECTRUM Interpretation
• Cosine = sum of 2 complex exponentials:
One has a positive frequency The other has negative freq
Amplitude of each is half as big
t j
A t
j
t
A cos( 7 ) = 2 7 + 2 − 7
Trang 13SPECTRUM of SINE
• Sine = sum of 2 complex exponentials:
– Positive freq has phase = -0.5π
t j j
t j j
t
j j
A t
j j
A
e Ae
e Ae
e e
t
A
7 5
.
0 2
1 7
5
0 2
1
7 2
7 2
) 7
π
5 0
j = j = e
−
Trang 14Negative Frequency
• Is negative frequency real?
• Doppler Radar provides an example
– Police radar measures speed by using the Doppler shift principle
– Let’s assume 400Hz ßà60 mph
– +400Hz means towards the radar
– -400Hz means away (opposite direction )
– Think of a train whistle
Trang 15t j
j e Ae e Ae
t
A sin( 7 ) = 21 − 0.5π 7 + 21 0.5π − 7
π
5
0 2
Trang 16SPECTRUM 2 SINUSOID
• Add the spectrum components:
What is the formula for the signal x(t)?
–100 –250
f (in Hz)
3 /
7 e j π 7 e − j π / 3
2 /
10
Trang 17Gather (A,ω,φ) information
DC is another name for zero-freq component
DC component always has φ=0 or π (for real x(t) )
Note the conjugate phase
Trang 18Add Spectrum Components-1
• Amplitude & Phase
j t
j j
t j
j t
j j
e e
e e
e e
e e
t
x
) 250 (
2 2
/ )
250 (
2 2
/
) 100 (
2 3
/ )
100 (
2 3
/
4 4
7 7
10 )
(
π π
π π
π π
π π
=
Trang 19Add Spectrum Components-2
t j
j t
j j
t j
j t
j j
e e
e e
e e
e e
t
x
) 250 (
2 2
/ )
250 (
2 2
/
) 100 (
2 3
/ )
100 (
2 3
/
4 4
7 7
10 )
(
π π
π π
π π
π π
+
=
–100 –250
f (in Hz)
3 /
7 e j π 7 e − j π / 3
2 /
10
Trang 20Use Euler’s Formula to get REAL sinusoids:
Simplify Components
t j
j t
j j
t j
j t
j j
e e
e e
e e
e e
t
x
) 250 (
2 2
/ )
250 (
2 2
/
) 100 (
2 3
/ )
100 (
2 3
/
4 4
7 7
10 )
(
π π
π π
π π
π π
+
=
t j j
t j
j e Ae e Ae
Trang 21N k
k k
A A
250 (
2 cos(
8
) 3 / )
100 (
2 cos(
14 10
)
(
π π
π
π
+ +
− +
=
t
t t
x
Trang 22Summary: General Form
∗+
=
ℜ e { z } 21 z 21 z k
j k
k
f
e A
=
= Frequency
=
N
k
t f
j
ke kX
e X
t
x
1
20
j k
t f
j
ke k X e kX
X t
x
1
22
1
22
10
=
N
k
k k
k f t A
A t
Trang 23Example: Synthetic Vowel
• Sum of 5 Frequency Components
Trang 24SPECTRUM of VOWEL
– Conjugates in negative frequency
Trang 25SPECTRUM of VOWEL (Polar
Format)
φ k
0.5Ak
Trang 26Vowel Waveform (sum of all 5 components)
Trang 27Problem Solving Skills
• MATLAB
– Numerical – Computation – Plotting list of numbers
Trang 28Lecture Objectives
• Signals with HARMONIC Frequencies
FREQUENCY can change vs TIME
=
N k
k
A A
Trang 29–100 –250
f (in Hz)
3 /
7 e j π 7 e − j π / 3
2 /
10
) 2 / )
250 (
2 cos(
8
) 3 / )
100 (
2 cos(
14 10
)
(
π π
π
π
+ +
− +
=
t
t t
x
k
j k
Trang 30Spectrum for Periodic Signals?
• Nearly Periodic in the Vowel Region
Trang 31) ( t x t T
) 3 ( cos )
Trang 32Period of Complex Exponentials
Definition: Period is T
k = integer
t j
T t
? ) ( )
(
)
(
t x T
t
x
e t
= +
e π
k T
⇒
k
k T
Trang 33=
+ +
=
N k
t kf
j k
t kf
j k
j k k
N k
k k
e X
e X
X t
x
e A X
t kf A
A t
x
k
1
2 2
1
2 2
1 0
1
0 0
0 0
) (
) 2
cos(
) (
π π
ϕ
ϕ π
Harmonic Signal Spectrum
0
: have only
can signal
T
f 0 = 1
Trang 34Define Fundamental Frequency
l fundamenta
(largest) Frequency
l fundamenta
) 2
(
) 2
0
1
0 0
k f
t kf A
A t
x
k
N k
k k
π ω
ϕ π
Trang 35What is the fundamental frequency?
Harmonic Signal (3 Freqs)
3rd
5th
10 Hz
Trang 36POP QUIZ: Fundamental Freq
• Here’s another spectrum:
What is the fundamental frequency?
–100 –250
f (in Hz)
3 /
7 e j π 7 e − j π / 3
2 /
10
Trang 37SPECIAL RELATIONSHIP
to get a PERIODIC SIGNAL
IRRATIONAL SPECTRUM
Trang 38Harmonic Signal (3 Freqs)
T=0.1
Trang 39NON-Harmonic Signal
NOT PERIODIC
Trang 40§ Can a machine extract frequencies?
§ Yes, if we COMPUTE the spectrum for x(t)
§ During short intervals
Trang 42A Simple Test Signal
• C-major SCALE: stepped frequencies
– Frequency is constant for each note
IDEAL
Trang 43R-rated: ADULTS ONLY
• SPECTROGRAM Tool
• ANALYSIS program
– Takes x(t) as input &
§ Then uses the FFT (Fast Fourier Transform)
Trang 44R-rated: ADULTS ONLY
• SPECTROGRAM Tool
• ANALYSIS program
– Takes x(t) as input &
§ Then uses the FFT (Fast Fourier Transform)
CSI
Progress
Level:
Trang 45Spectrogram Example
• Two Constant Frequencies: Beats
) ) 12 ( 2 sin(
) ) 660 (
2 cos( π t π t
Trang 46( ) ( j t j t )
j
t j
t
e 2 (660) 2 (660) 21 2 (12) 2 (12)2
− +
AM Radio Signal
• Same as BEAT Notes
) ) 12 (
2 sin(
) ) 660 (
2
) )
648 (
2 cos(
) )
672 (
2
22
1 π t − π + π t + π
j e 2 (672) e 2 (672) e 2 (648) e 2 (648)
Trang 47Spectrum of AM (Beat)
• 4 complex exponentials in AM:
What is the fundamental frequency?
f (in Hz) –672 –648
2
/ 4
1 e jπ 41 e− jπ /2
2
/ 4
Trang 48Stepped Frequencies
• C-major SCALE: successive sinusoids
– Frequency is constant for each note
IDEAL
Trang 50Spectrogram of LAB SONG
ARTIFACTS at Transitions Sinusoids ONLY
Analysis Frame = 40ms
Trang 51Time-Varying Frequency
• Frequency can change vs time
– Continuously, not stepped
• FREQUENCY MODULATION (FM)
• CHIRP SIGNALS
– Linear Frequency Modulation (LFM)
)) (
2 cos(
)
VOICE
Trang 52) 2
cos(
) ( t = A α t 2 + π f 0 t + ϕ x
New Signal: Linear FM
• Called Chirp Signals (LFM)
– Quadratic phase
• Freq will change LINEARLY vs time
– Example of Frequency Modulation (FM)
– Define “instantaneous frequency”
QUADRATIC
Trang 53)) (
cos(
)
(
t t
t A
t x
0
2 )
( )
(
2 )
(
) 2
cos(
) (
f t
t
t f t
t f A
t x
dt d
ω
ϕ π
ψ
ϕ π
Trang 54Instantaneous Frequency of the
Chirp
• Chirp Signals have Quadratic phase
• Freq will change LINEARLY vs time
ϕ β
α ψ
ϕ β
α
+ +
=
⇒
+ +
=
t t
t
t t
A t
x
2
2
) (
) cos(
) (
β α
ψ
⇒ i ( t ) dt d ( t ) 2 t
Trang 55Chirp Spectrogram
Trang 56Chirp Waveform
Trang 57) ( )
⇒
Trang 58Sine-Wave Frequency Modulation (FM)
Look at CD-ROM Demos in Ch 3
Trang 59• Next week <> Section 3-4
Section 3-5 Section 3-6 Lab 2