(ppt) dft dtfs and transforms (stanford)

13
Signals and Systems, 2012 1 Discrete Fourier Transform Discrete Time Fourier Series and Transforms The goal of this section is to develop methods of representing periodic discrete-time signals in the form of a finite Fourier series. These methods are to replace the continuous-time methods when one only has discrete-time samples of the continuous-time signal. Some material is taken from Prof. J. Pauly’s notes (Stanford University) and is used with his permission

Upload: wesley-george

Post on 07-Dec-2015

29 views

Category:

Documents


8 download

DESCRIPTION

DFT DFS

TRANSCRIPT

Page 1: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 1

Discrete Fourier Transform

Discrete Time Fourier Series and Transforms

The goal of this section is to develop methods of representing periodic discrete-timesignals in the form of a finite Fourier series.

These methods are to replace the continuous-time methods when one only hasdiscrete-time samples of the continuous-time signal.

Some material is taken from Prof. J. Pauly’s notes (Stanford University) and is used with his permission

Page 2: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 2

Discrete Fourier Transform as an approximation to the CTFS

Recall that a periodic continuous-time signal x(t), with a fundamental period T0, canbe represented in the form of Fourier series

x(t) =

∞∑

k=−∞

Xke2πjkt/T0 , Xk =1

T0

∫ T0

0

x(t)e−2πjkt/T0dt.

Suppose we only know samples of x(t), taken every by Ts seconds, i.e, we takeNs = T0/Ts samples of x(t) per period.

We still can compute the Fourier series usingnumerical integration.Let us approximate x(t) between the samplesusing the Zero Order Hold :

x(t) = x(nTs) for nTs ≤ t < (n+1)Ts.

Page 3: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 3

Then we can compute the harmonic coefficients approximately,

Xk =1

T0

∫ T0

0

x(t)e−j2πk t

T0 dt

≈1

T0

Ns−1∑

n=0

∫ (n+1)Ts

nTs

x(nTs)e−j2πk t

T0 dt

=e−jπ k

Ns sinc(

kNs

)

Ns

Ns−1∑

n=0

x(nTs)e−j2πk n

Ns

≈1

Ns

Ns−1∑

n=0

x(nTs)e−j2πk n

Ns for |k| ≪ Ns.

The expression in the box is called the Discrete Fourier Transform of the periodicsequence x[n] = x(nTs).

• The term ‘Fourier Transform’ could be confusing, since the DFT is a finite series.

Page 4: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 4

Discrete Fourier Transform

• The DFT of a periodic sequence x[n], with fundamental period N , is defined as

DFT (x) = X[k] =

N−1∑

n=0

x[n]e−j2πk n

N , k = 0, . . . , N − 1.

• The DFT takes a finite sequence of numbers representing one period of x[n], andproduces another periodic sequence, with the same period N .

• Conversely, given the DFT of a periodic sequence x[n], X[k], the corresponding

time-domain sequence x[n] is obtained from X[k] using the inverse DFT, or IDFT:

x[n] =1

N

N−1∑

k=0

X[k]ej2πn k

N .

• In Matlab, the name of the DFT function is fft, which stands for Fast FourierTransform, with reference to one particular algorithm for computing the DFT. Thename of the IDFT function is ifft.

Page 5: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 5

Discrete Time Fourier Series and DFT

Textbooks define Discrete Time Fourier Series (DTFS) as a counterpart of theContinuous Time Fourier Series, as follows

DTFS DFT

Direct X[k] =1

N

N−1∑

n=0

x[n]e−j2πk n

N X[k] =

N−1∑

n=0

x[n]e−j2πk n

N

Inverse x[n] =

N−1∑

k=0

X[k]ej2πn k

N x[n] =1

N

N−1∑

k=0

X[k]ej2πn k

N

• When using the Matlab fft function be sure to normalize the result, because

X[k] =1

NX[k], DTFS(x[n]) =

1

NDFT (x[n]).

Page 6: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 6

Properties of Discrete Fourier Transform

• The DFT is the discrete Fourier series, its properties are similar to that of Fourierseries and Fourier Transform

• Linearity Let x and y be two periodic signals, and let N be the least commonmultiple of their periods. Then

DFT (ax[n] + by[n]) = aX[k] + bY[k], k = 0, . . . , N − 1.

• Time shifting (Circular shifting, since we are looking at periodic sequences):

DFT (x[n − m]) = DFT (x[n])e−j2πk m

N

• Duality If X[k] = DFT (x[n]), then DFT (X[k]) = Nx[−n], i.e., we recoverthe original sequence but scaled by a factor of N and flipped, sincex[−n] = x[N − n].

• Parseval Theorem

Px =1

N

N−1∑

n=0

|x[n]|2 =1

N2

N−1∑

n=0

|X[k]|2 =

N−1∑

n=0

|X[k]|2.

Page 7: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 7

Circular (Periodic) Convolution

Let x and y be two periodic signals, and let N be the least common multiple of theirperiods.

The circular convolution (periodic convolution) is defined as

z[n] = y©∗ x =

N−1∑

m=0

y[m]x[n − m]

The sequences are of infinite length, but the summation is over one common period ofthe two sequences. The result is the same as using linear convolution with one of thesequences padded with 0 beyond the fundamental period.

• Circular (Periodic) convolution

DFT (x[n]©∗ y[n]) = Y[k] · X[k], DFTS(x[n]©∗ y[n]) = Y [k] · X[k].

• Multiplication

DFT (x[n]·y[n]) =1

NY[k]©∗ X[k], DFTS(x[n]·y[n]) = N ·Y [k]©∗ X[k].

Page 8: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 8

Common DFT problems: spectrum leakage and aliasing

The DFT algorithm is implemented in Matlab (function fft), it is commonly used insignal processing of periodic sampled continuous-time and discrete time sequences.

Commonly occurring problems in using DFT are due to aliasing and spectrum leakage

To illustrate these problems consider cos ω0t of infinitelength.

cos(ω0t) =ejω0t + e−jω0t

2Its Fourier transform was found

X(jω) = π [δ(ω − ω0) + δ(ω + ω0)]−ω0 ω0 ω

|X(jω)|π

To apply the DFT (i.e., to compute the spectrum numerically), the signal of infinitelength such as cos(ω0t) must be truncated.

Truncation effectively introduces a time window WT (t) = rectT (t) during which thecontinuous-time signal is observed. The DFT then generates the approximatespectrum of the truncated signal xT (t) = rectT (t) cos(ω0t),

XT (jω) = X(jω) ∗ [T sinc(ωT/(2π))] , assuming a rectangular window.

Page 9: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 9

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1Signal x(t)

Time, sec

x(t)

−10 −8 −6 −4 −2 0 2 4 6 8 10

0

0.1

0.2

0.3

0.4

0.5

Amplitude Spectrum of x(t)

Frequency (Hz)

|X(f

)|

cos(5]pi t), t ∈ [−1,1]cos(5π t), t ∈ [−.5,.5]cos(5π t), with Hanning Window

• The convolution produces two overlapping (to a various degree) main lobes around±ω0 and many smaller side lobes. This effect is known as spectrum leakage -small spectrum peaks appear everywhere.

• To reduce leakage

(a) Use wider windows (longer signals), sinc gets compressed as T → ∞, henceless leakage.

(b) Use non-rectangular windows.

Page 10: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 10

• The windowed signal xT (t) has a finite duration, hence it is no longer band-limited.

Sampling such a signal within the window will produce aliases in the spectrum bycreating multiple replicas of XT (jω) repeated periodically, and the adjacentreplicas will overlap.

• To reduce aliasing

(a) Oversample! A high sampling rate helps to reduce overlapping of aliases ofXT (jω). In the example, a sampling rate of 64kHz was used for the signal of2.5Hz.

(b) Use antialiasing (low-pass) filter to narrow the bandwidth of the signal.

Page 11: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 11

Windowing

Using nonrectangular windows alleviates spectrum leakageproblems. For example, Hanning window

w[n] =1

2(1 − cos(

2πn

L − 1)),

n = 0, . . . , L − 1,0 5 10 15 20 25

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Time, sec

L is the number of signal samples within thewindow.

Using nonrectangular windows, suppressessidelobes.

Several most common windows are listed inRoberts, Chapter 14, Problem 22. −10 −8 −6 −4 −2 0 2 4 6 8 10

0

0.1

0.2

0.3

0.4

0.5

Amplitude Spectrum of x(t)

Frequency (Hz)

|X(f

)|

cos(5]pi t), t ∈ [−1,1]cos(5π t), t ∈ [−.5,.5]cos(5π t), with Hanning Window

Page 12: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 12

Connections between various Fourier techniques

Discrete Frequency Continuous Frequency

Periodic in time Aperiodic in time

Continuous CTF Series CTF Transform

Time Xk =1

T

∫ ta+T

ta

x(t)e−j2πk t

T dt, X(jω) =

−∞

x(t)e−jωtdt,

x(t) =

∞∑

n=−∞

Xkej2πk t

T x(t) =1

−∞

X(jω)ejωtdω

Discrete DTF Series, DFT DTF Transform

Time X(jω) =

∞∑

n=−∞

x[n]e−jnω ,

x[n] =1

∫ ωa+2π

ωa

X(jω)ejnωdω

Page 13: (Ppt) DFT DTFS and Transforms (Stanford)

Signals and Systems, 2012 13

Conclusion

• In addition to formal mathematical similarities, similarities and differences betweenvarious Fourier operations are related to the nature of signals and systemsanalyzed.

– If signal is discrete in one domain, it is periodic in another domain. In particular,periodic signals have discrete spectra, they are are power signals.

– Time-domain sampling of continuous time signals causes signal spectra tobecome periodic by generating aliases. Yet, aperiodic sampled signals willgenerally have continuous spectrum and must be analyzed using Discrete-TimeFourier Transform.

– Continuous time periodic signals have a discrete frequency spectrum, andtherefore, can be resolved in to a sum of complex sinusoids rather than anintegral (i.e. can be analyzed using CTFS).

– Bandlimited signals have infinite duration. Finite duration signals have infinitespectra. Sampling such signals produces overlapping aliases. One side effectof aliasing due to finite signal capture is spectrum leakage.

• Each method has its own version of Parseval Theorem to facilitate calculations ofsignal power/energy, and its own version of convolution to facilitate calculations ofzero-state response.