33
ECE 2026 Summer 2022 LECTURE #4 Fourier Series and Instantaneous Frequency Wed May 25, 2022

SPFirst Lecture #2 - gatech.edu

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SPFirst Lecture #2 - gatech.edu

ECE 2026 Summer 2022

LECTURE #4Fourier Series and Instantaneous FrequencyWed May 25, 2022

Page 2: SPFirst Lecture #2 - gatech.edu

MATLAB review tonight

Page 3: SPFirst Lecture #2 - gatech.edu

Ch. 3 Reading:

Monday:

Today

3

Page 4: SPFirst Lecture #2 - gatech.edu

The Fourier Series

A periodic signal satisfies x( t) = x( t + T0) for all t.

Any periodic signal can be written as

with harmonically related frequencies, whose amplitudes and phases are determined by the FS coefficients:

smallest is fundamental period

0

0

0

0ak = dt

t0 T0

……

“FS synthesis”

“FS analysis”

Page 5: SPFirst Lecture #2 - gatech.edu

Analysis Not Always Necessary

ECE-2026 Spring 2022 5

Page 6: SPFirst Lecture #2 - gatech.edu

ECE-2026 Spring 2022 6

Page 7: SPFirst Lecture #2 - gatech.edu

Motivating Example: A Sawtooth Wave

0 0.1 t

Page 8: SPFirst Lecture #2 - gatech.edu

Derivation of FS Coeffsa0 = π

ak = j/k

0

Resulting spectrum:

a1 = j

a2 = j/2

Page 9: SPFirst Lecture #2 - gatech.edu

Sawtooth Example:

a0 = π

ak = j/k

0

Spectrum: a1= j

a2= j/2

ak0

0

,

,

k

jk

k

π ==

f [Hz]

f0 = 10 Hz

0 0.1

T0 = 0.1

20 30 40 50 60

Page 10: SPFirst Lecture #2 - gatech.edu

+40 Hz

+30 Hz

+20 Hz

Periodic signal = sum of sinusoids:

• Harmonic:Sinusoid freq’s all multiples of f0(Spectrum lines spaced by f0)

• Amp & phase determined by FS coeffs

constant+10 Hz

2 questions:

• Is sum of harmonic sinusoids always periodic?

• Can anything periodic be written this way?

Page 11: SPFirst Lecture #2 - gatech.edu

5/23/2022 ECE-2026 Spring 2022 11

Fourier Series Demofseriesdemo

Page 12: SPFirst Lecture #2 - gatech.edu

FS of 50% Square Wave?

0.10 0.05

π

t

x( t )

……

T0 = 0.1

Page 13: SPFirst Lecture #2 - gatech.edu

Resulting Spectrum

a0 = π/2

ak = j/k

0

a1= j

f [Hz]

f0 = 10 Hz

30 50 70 90

Page 14: SPFirst Lecture #2 - gatech.edu

As Sums of Sinusoids

t=0:1e-4:0.4;

x=pi;

for k=1:1:400; x = x - 2*sin(20*pi*k*t)/k; end;

y=pi/2;

for k=1:2:400; y = y - 2*sin(20*pi*k*t)/k; end;

plot(t,x,t,y);

14

Page 15: SPFirst Lecture #2 - gatech.edu

Gibbs Phenomenon

Page 16: SPFirst Lecture #2 - gatech.edu

Analogy

3D Vectors Periodic SignalsDot product

orthogonal basis {u1, u2, u3}

x = a1u1 + a2u2 + a3u3

ak = x . uk

{ }02 /

k

jk t Te∞

=−∞

π

02 /( ) jk t Tk

k

x t a e∞

π

=−∞

= ∑

0

0

0

1 2 /( ) jk t Tk T

T

a x t e dt− π= ∫

integral

Page 17: SPFirst Lecture #2 - gatech.edu

A complex periodic z( t ) = akejk2πt

K

k K=−∑

Page 18: SPFirst Lecture #2 - gatech.edu

Works for complex periodic z( t ) too

K = 3 K = 10 K = 30

K = 100 K = 300 K = 10,000

For more FS animations see https://youtu.be/-qgreAUpPwM

Page 19: SPFirst Lecture #2 - gatech.edu

19

YES

Sum of Sinusoids: Periodic?

NO

Page 20: SPFirst Lecture #2 - gatech.edu

YES

NO

T 0 = 0.1

Page 21: SPFirst Lecture #2 - gatech.edu

Fun FS Facts If x(t) real then a −k = a k * “Hermitian” symmetry The zero-th “DC” coeff is often computed separately,

can interpret as “average” value If x(t) is even, a k are purely real:

If x(t) is odd, a k are purely imaginary. Integration not always needed to find FS coeffs.

Page 22: SPFirst Lecture #2 - gatech.edu

Pop Quiz

Page 23: SPFirst Lecture #2 - gatech.edu

23

Pop Quiz: Is This Signal Periodic?

What is the fundamental frequency?

(0.1)GCD(104,240) = (0.1)(8) = 0.8 Hz

0 10.4 24–10.4–24 f (in Hz)

37 /πje 37 /π−je2/4 πje− 24 /πje

10

Page 24: SPFirst Lecture #2 - gatech.edu

Arbitrary Duty Cycle

ECE-2026 Spring 2022 24

Page 25: SPFirst Lecture #2 - gatech.edu

5/23/2022 25

Time-Varying Frequency Chirp:

How to define “instantaneous” frequency? Break signal into sections Estimate frequency for each section Plot frequency estimates vs time

Page 26: SPFirst Lecture #2 - gatech.edu

That’s what spectrogram doesspectrogram(x,2^12,[],2^14,fs,'yaxis')

Page 27: SPFirst Lecture #2 - gatech.edu

5/23/2022 27

Instantaneous Frequency

When

Sanity check: pure sinusoid

“Angle” derivative1

2

( ) cos( ( ))

( ) ( )di dt

x t A t

f t tπ

= ψ

⇒ = ψ

0

0

2( ) cos( )

( )i

x t A f t

f t f

= π + ϕ⇒ =

Page 28: SPFirst Lecture #2 - gatech.edu

5/23/2022 28

Linear Chirp

Derivative linear in time phase is quadratic in time:

2( ) cos( )x t A t t= α + β + ϕ

QUADRATIC

Page 29: SPFirst Lecture #2 - gatech.edu

Pop Quiz: Create Linear Chirp

=ϕ=β=α

ϕ+β+α=⇒

where

2 )cos()( ttAtx

…that starts at 500 Hz, ends at 1000 Hz, and lasts for 4 seconds

Page 30: SPFirst Lecture #2 - gatech.edu

Pop Quiz: Write Eqn for Siren

))sin(cos()( ϕ+γ+βα+ω=⇒ ttAtx

… where ω = 1000π, α = 25, β = 8π, γ = ϕ = 0

Page 31: SPFirst Lecture #2 - gatech.edu

Spectral Analysis using FFTfs = 100;

t = 0:1/fs:10;

x = sin(2*pi*15*t) + 2*cos(2*pi*40*t + 0.3*pi) + randn(size(t));

plot(linspace(-fs/2,fs/2,length(x)),abs(fftshift(fft(x))));

xlabel('Frequency (Hz)')

Page 32: SPFirst Lecture #2 - gatech.edu

What’s This?

TIME (seconds)

FRE

QU

EN

CY

(kH

Z)

0

5

https://youtu.be/N2njKC5Iix8?t=10

spectrogram(x,1024,[],1024,fs,'yaxis');

Page 33: SPFirst Lecture #2 - gatech.edu

5/23/2022 ECE-2026 Spring 2022 33

SPECTROGRAM

MATLAB function is spectrogram.m SP-First has plotspec.m & spectgr.m Takes x( t ) as input Breaks x( t ) into short segments then uses the FFT (Fast Fourier Transform) produces spectrum values Xk