Overview of DT Fourier Series Topics Orthogonality of DT exponential - - PowerPoint PPT Presentation

overview of dt fourier series topics orthogonality of dt
SMART_READER_LITE
LIVE PREVIEW

Overview of DT Fourier Series Topics Orthogonality of DT exponential - - PowerPoint PPT Presentation

Overview of DT Fourier Series Topics Orthogonality of DT exponential harmonics DT Fourier Series as a Design Task Picking the frequencies Picking the range Finding the coefficients Example J. McNames Portland State


slide-1
SLIDE 1

Overview of DT Fourier Series Topics

  • Orthogonality of DT exponential harmonics
  • DT Fourier Series as a Design Task
  • Picking the frequencies
  • Picking the range
  • Finding the coefficients
  • Example
  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

1

slide-2
SLIDE 2

Motivation

x[n] y[n]

h[n]

x[n] y[n]

H(ejΩ)

ejΩn → H(ejΩn)ejΩn

  • k

X[k] ejΩkn →

  • k

X[k] H(ejΩkn)ejΩkn H(ejΩ) = F {h[n]} =

  • n=−∞

h[n] e−jΩn

  • For now, we restrict out attention to DT periodic signals:

x[n + N] = x[n]

  • Would like to represent x[n] as a sum of complex sinusoids
  • Why? Gives us insight and simplifies computation
  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

2

slide-3
SLIDE 3

Example 1: Complex Sinusoidal Sum To solve for the DTFS coefficients, we need the following relation

  • n=<N>

ejkΩn =

  • N

k = ℓN, k = ℓN for any integer ℓ. Prove that this relation is true. Hint: recall the finite sum formula

N−1

  • n=0

an = 1 − aN 1 − a

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

3

slide-4
SLIDE 4

Example 1: Workspace

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

4

slide-5
SLIDE 5

DT Periodic Signals Design Task

1 2 1

n

  • 1

x[n]

  • 2
  • 3
  • 4

3 4

x[n] =

  • 1.0

n = 3k 0.5 Otherwise

  • Suppose we have a DT signal x[n] that we know is periodic
  • The signal is applied at the input of an LTI system
  • We would like to estimate the signal as a sum of complex sinusoids

ˆ x[n] =

  • k

X[k] ejΩkn

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

5

slide-6
SLIDE 6

DT Periodic Signals Design Task ˆ x[n] =

  • k

X[k] ejΩkn

  • Here theˆsymbol is used to indicate that the sum is an

approximation (estimate) of x[n]

  • Enables us to calculate the system output easily
  • Must pick

– The frequencies Ωk – The range of the sum

k

– The coefficients X[k]

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

6

slide-7
SLIDE 7

Design Task: Picking the Frequencies ˆ x[n] =

  • k

X[k] ejΩkn

  • We know x[n] is periodic with some fundamental period N
  • If ˆ

x[n] is to approximate x[n] accurately, it should also repeat every N samples

  • In order for ˆ

x[n] to be periodic with period N, every complex sinusoid must also be periodic

  • Only a harmonic set of complex sinusoids have this property
  • Thus Ωk = kΩ where Ω = 2π

N

ˆ x[n] =

  • k

X[k] ejkΩn

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

7

slide-8
SLIDE 8

Design Task: Picking the Range ˆ x[n] =

  • k

X[k] ejkΩn

  • Recall that there are only N distinct complex sinusoids that repeat

every N samples ejkΩn = ej(k+ℓN)n where Ω = 2π

N

  • Thus we can pick the range of the sum so that it includes only

these terms

  • Typical choices

ˆ x[n] =

N−1

  • k=0

X[k] ejkΩn ˆ x[n] =

(N−1)/2

  • k=−(N−1)/2

X[k] ejkΩn

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

8

slide-9
SLIDE 9

Equivalent Expressions for Exponential Sums x[n] =

  • k

X[k] ejkΩn Since only N of the harmonics are distinct, we may truncate the sum so that it only contains only N distinct terms. It does not matter which set of N terms are used. x[n] =

N−1

  • k=0

X[k] ejkωn =

N−1+ℓ

  • k=ℓ

X[k] ejkωn =

  • k=<N>

X[k] ejkωn Note the new notation:

  • k=<N>

X[k] ejkωn

N+ℓ

  • k=1+ℓ

X[k] ejkωn for any ℓ

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

9

slide-10
SLIDE 10

Design Task: Picking the Coefficients ˆ x[n] =

  • k=<N>

X[k] ejkΩn MSE = 1 N

  • n=<N>

|x[n] − ˆ x[n]|2

  • We would like to pick the coefficients X[k] so that ˆ

x[n] is as close to x[n] as possible

  • But what is close?
  • One measure of the difference between two signals is the mean

squared error (MSE)

  • There are other measures, but this is a convenient one because we

can differentiate it

  • Since the signal is periodic, the MSE is calculated over a single

fundamental period of N consecutive samples

  • How do we pick the coefficients X[k] to minimize the MSE?
  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

10

slide-11
SLIDE 11

Design Task: Coefficient Optimization ˆ x[n] =

  • k=<N>

X[k] ejkΩn MSE = 1 N

  • n=<N>

|x[n] − ˆ x[n]|2

  • Solving for the optimal coefficients is difficult
  • However, suppose that an optimal solution exists such that

MSE = 0

  • If such a solution exists, we know the sum of errors will also be

zero 0 =

  • n=<N>

x[n] − ˆ x[n]

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

11

slide-12
SLIDE 12

Design Task: Solve for the Coefficients 0 =

  • n=<N>

x[n]e−jℓΩn −

  • n=<N>

ˆ x[n]e−jℓΩn

  • n=<N>

x[n]e−jℓΩn =

  • n=<N>

ˆ x[n]e−jℓΩn

  • n=<N>

x[n]e−jℓΩn =

  • n=<N>

k=<N>

X[k] ejkΩn

  • e−jℓΩn

=

  • k=<N>

X[k]

  • n=<N>

ejkΩne−jℓΩn =

  • k=<N>

X[k]

  • n=<N>

ej(k−ℓ)Ωn =

  • k=<N>

X[k] (Nδ[k − ℓ]) = X[ℓ]N

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

12

slide-13
SLIDE 13

Design Task: Optimal Coefficients Thus, the coefficient of the ℓth complex sinusoid that minimize the MSE is X[ℓ] = 1 N

  • n=<N>

x[n]e−jℓΩn

  • With more algebra, you should be able to show that these

coefficients result in MSE = 0!

  • Thus, ˆ

x[n] = x[n]

  • This means any DT periodic signal can be exactly represented as a

sum of N complex sinusoidal harmonics

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

13

slide-14
SLIDE 14

DTFS Observations x[n] =

  • k=<N>

X[k] ejkΩn X[k] = 1 N

  • n=<N>

x[n]e−jkΩn

  • The first equation is called the synthesis equation
  • The second equation is called the analysis equation
  • The coefficients X[k] are called the spectral coefficients or

Fourier series coefficients of x[n]

  • We denote the relationship of x[n] and X[k] by

x[n]

FS

⇐ ⇒ X[k]

  • Both are complete representations of the signal: if we know one,

we can compute the other

  • X[k] is a function of frequency (kΩ)
  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

14

slide-15
SLIDE 15

Further DTFS Observations & Comments x[n] =

  • k=<N>

X[k] ejkΩn X[k] = 1 N

  • n=<N>

x[n]e−jkΩn

  • The DTFS transform is special because both sums are finite

– This permits us to calculate the DTFS exactly with computers (e.g. MATLAB) and microprocessors – Later we will see how the DTFS is used to compute the other 3 transforms

  • The Fourier series representation of signals is useful for LTI system

design and analysis because we know how LTI systems affect sinusoidal signals

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

15

slide-16
SLIDE 16

Example 2: Pulse

m 1

n x[n]

  • m

N

  • N

What type of symmetry does the signal have? Find the DT Fourier series coefficients. Plot the coefficient spectrum, partial sums of the Fourier series components, and the MSE versus number of coefficients.

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

16

slide-17
SLIDE 17

Example 2: Workspace

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

17

slide-18
SLIDE 18

Example 2: Coefficient Spectrum

−25 −20 −15 −10 −5 5 10 15 20 25 −0.2 −0.1 0.1 0.2 0.3 0.4 0.5 kth (harmonic) X[k] Discrete−Time Fourier Series Coefficients X[k]

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

18

slide-19
SLIDE 19

Example 2: Partial Fourier Series

−15 −10 −5 5 10 15 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 1.2 Time (samples) Partial Fourier Series Approximation (k=0)

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

19

slide-20
SLIDE 20

Example 2: Partial Fourier Series

−15 −10 −5 5 10 15 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 1.2 Time (samples) Partial Fourier Series Approximation (k=−1 to 1)

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

20

slide-21
SLIDE 21

Example 2: Partial Fourier Series

−15 −10 −5 5 10 15 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 1.2 Time (samples) Partial Fourier Series Approximation (k=−2 to 2)

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

21

slide-22
SLIDE 22

Example 2: Partial Fourier Series

−15 −10 −5 5 10 15 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 1.2 Time (samples) Partial Fourier Series Approximation (k=−3 to 3)

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

22

slide-23
SLIDE 23

Example 2: Partial Fourier Series

−15 −10 −5 5 10 15 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 1.2 Time (samples) Partial Fourier Series Approximation (k=−4 to 4)

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

23

slide-24
SLIDE 24

Example 2: Partial Fourier Series

−15 −10 −5 5 10 15 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 1.2 Time (samples) Fourier Series Synthesis (k=−5 to 5)

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

24

slide-25
SLIDE 25

Example 2: Mean Squared Error

1 2 3 4 5 6 7 8 9 10 11 0.05 0.1 0.15 0.2 0.25 Coefficients MSE

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

25

slide-26
SLIDE 26

Example 2: MATLAB Code

N = 11; m = 2; T = 11; w = 2*pi/N; n = (-15:15); t = (-15:0.01:15)’; figure(1); K = -25:25; for c1 = 1:length(K), k = K(c1); if k==0, a(c1) = (1/N)*(m+1/2)/(1/2); else a(c1) = (1/N)*sin(w*k*(m+1/2))./sin(w*k/2); end; end; h = stem(K,a); set(h,’Color’,[0 0.6 0]); set(h(1),’Marker’,’.’); set(h(1),’MarkerSize’,10); set(h(2),’LineWidth’,1.0); xlabel(’kth (harmonic)’); ylabel(’a_k’); title(’Discrete-Time Fourier Series Coefficients a_k’);

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

26

slide-27
SLIDE 27

Example 2: MATLAB Code Continued

NP = 0:(N-1)/2; k = 1:N-1; a(1) = (1/N)*(m+1/2)/(1/2); a(k+1) = (1/N)*sin(w*k*(m+1/2))./sin(w*k/2); tm = mod(n,N); x = 1*(tm<=m) + 1*(tm>=N-m); for c1 = 1:length(NP), figure; hold on; xd = zeros(size(n)); xc = zeros(size(t)); for c2 = 1:c1, k = c2-1; if k==0, xpd = a(c2)*exp(j*k*w*n); xpc = a(c2)*exp(j*k*w*t); else xpd = a(c2)*exp(j*k*w*n) + conj(a(c2))*exp(-j*k*w*n); xpc = a(c2)*exp(j*k*w*t) + conj(a(c2))*exp(-j*k*w*t); end; h = plot(t,xpc); set(h,’Color’,[0.0 0.6 0.0]); set(h,’LineWidth’,0.2);

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

27

slide-28
SLIDE 28

Example 2: MATLAB Code Continued

h = plot(n,xpd,’.’); set(h,’Color’,[0.0 0.6 0.0]); set(h,’MarkerSize’,6); xd = xd + xpd; xc = xc + xpc; end; h = plot(t,xc,’k’); set(h,’LineWidth’,0.4); h = stem(n,x,’r’); set(h(1),’Marker’,’.’); set(h(1),’MarkerSize’,11); set(h(2),’LineWidth’,1.4); h = stem(n,xd,’b’); set(h(1),’Marker’,’.’); set(h(1),’MarkerSize’,8); set(h(2),’LineWidth’,0.8); xlabel(’Time (samples)’); st = sprintf(’Fourier Series Approximation (k=%d to %d)’,-(c1-1),c1-1); title(st); xlim([min(t) max(t)]); ylim([-0.70 1.20]); end;

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

28

slide-29
SLIDE 29

DTFS Terminology x[n] =

  • k=<N>

X[k] ejkΩn X[k] = 1 N

  • n=<N>

x[n]e−jkΩn

  • X[k] is complex-valued in general
  • The function |X[k]| is called the magnitude spectrum of x[n]
  • The function arg X[k] is called the phase spectrum of x[n]
  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

29

slide-30
SLIDE 30

Example 3: Impulse Train Find THE DTFS coefficients of a periodic impulse train, x[n] =

  • ℓ=−∞

δ[n − ℓN]

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

30

slide-31
SLIDE 31

Example 3: Workspace

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

31

slide-32
SLIDE 32

Summary

  • A finite sum of complex sinusoids can represent any DT periodic

signal!

  • The coefficients of these sinusoids are useful for signal analysis

and LTI system design

  • J. McNames

Portland State University ECE 223 DT Fourier Series

  • Ver. 1.04

32