dtft and fourier transform consider a continuous-time signal x a (t), and a sequence x(n) obtained...

43
DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: nT x n x a x a (t) has a fourier transform, X a (f). x(n) has a DTFT, X(e j2ft ). In chapter 6, this relationship was asserted without proof: s n a fT j nf f X T e X 1 2 It will now be proven.

Upload: bernadette-fox

Post on 25-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier TransformConsider a continuous-time signal xa(t), and a sequence x(n) obtained by sampling xa(t) with sampling period T:

nTxnx a

xa(t) has a fourier transform, Xa(f). x(n) has a DTFT, X(ej2ft). In chapter 6, this relationship was asserted without proof:

sn

afTj nffX

TeX

12

It will now be proven.

Page 2: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier TransformConsider a continuous-time impluse train (Dirac impulses):

n

nTtts

T 2T 3T0T-T-2T-3T

s(t)

Page 3: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier TransformIf we multiply the impulse train and xa(t), we get a weighted impulse train.

na

nas

nTttx

nTttxtstx

The weights are the values of xa(t) at integer multiples of T. Since the product of the two signals is zero at all other times, it may also be expressed as:

n

as nTtnTxtstx

Page 4: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier TransformBut we’ve already seen that x(n) = xa(nT),

n

s nTtnxtx

xs(t) is a continuous time signal, which exists for all values of t, not just integer multiples of T. at t = nT, its value is that of x(n). At all other times, it is zero.

sn

afTj nffX

TeX

12

We’ll now prove

Page 5: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier TransformFirst, we’ll show that that

sn

as nffXT

fX

1

s(t) is periodic, with period T. It can be expressed as a Fourier series:

n

stfj

n Tfects s

1 ,2

The coefficients of the Fourier series, cn, are given by:

dtetsT

c tfjT

Tns22

2

1

Page 6: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier Transform

Only one of the impulses is between –T/2 and T-2, and s(t) is zero every where else between the integration limits, so:

dtetT

c tfjT

Tns 22

2

1

Using the sifting poperty of the continuous-time impulse,

Te

Tc sfjn

11 )0(2

Page 7: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier TransformSo the Fourier series representation of s(t) is

n

tfj seT

ts 21

The Fourier transform of s(t) is

n

tfj

n

tfj

a

s

s

eFT

eT

F

tsFfS

2

2

1

1

Page 8: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier TransformSince we have the following Fourier transform pair

02 0 ffe tfj

We can write the Fourier transform of s(t) as simply:

n

sa nffT

fS 1

Recalling that xs(t) = xa(t)s(t), we know that

fSfXfX aas

Page 9: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier Transform

Recalling that xs(t) = xa(t)s(t), we know that

nas

an

s

aa

aas

dfXnfT

dfXnfT

dfSS

fSfXfX

1

1

Page 10: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier Transform

And using the sifting property,

n

sas nffXT

fX1

The relationship we set out to prove was

n

safTj nffX

TeX

12

We’ve just shown that Xs(f) is equal to the right side of the relationship. Now we’ll show that Xs(f) is also equal to the left side, which will complete the proof.

Page 11: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier Transform

n

s nTtnxtx

Recall that

n

ns

nTtnxF

nTtnxFfX

So

Page 12: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

DTFT And Fourier Transform

fjet 2

Using this transform pair,

We can now write:

n

fTnjs enxfX 2

But this is the same as the DTFT of x(n), X(ej), if = 2pfT. Therefore,

fTjs eXfX 2

This completes the proof.

Page 13: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Sampling Theorem

A continuous time signal xa(t) that is bandlimited to B Hz (that is, its spectrum contains no energy at any frequency above B Hz) can be completely recovered from it’s samples, xa(nT) if the sampling frequency fs (fs = 1/T) is greater than 2B.

Xa(f)

f0 fs 2fs-2fs -fs B-B

Below is a depiction of the spectrum of a bandlimited signal xa(t).

A

Page 14: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Sampling Theorem

If fs > 2B, the sampled signal xs(t) is as depicted spectrally below:

Xs(f)

0 fs 2fs-2fs -fsB-B

A/T

where T = 1/ fs.

Spectrally, the sampled signal xs(t) is a scaled copy of xa(t) between –fs/2 and fs/2. It also contains spectral copies centered at n –fs.

Page 15: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Sampling Theorem

If we use an ideal lowpass filter to strip off the unwanted spectral copies, we can perfectly recover the spectrum of the original signal xa(t) – and therefore, we also recover xa(t) itself!

Again, if we have a signal xa(t) and sample it to obtain the weighted impulse train xs(t), we can recover xa(t) from xs(t) by using an ideal lowpass filter xa(t) is related to the sequence x(n) by

n

s nTtnxtx

Page 16: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

If we process the sequence x(n) in a way that converts it to xs(t), then use an ideal lowpass filter to strip off the unwanted spectral copies, then we convert a digital sequence to an analo signal. This is an ideal digital to analog (D/A) converter.

Convert to Impulse Train

Ideal Lowpass Filter

x(n)xs(t)

xa(t)

Gain = TCutoff freq = fs/2

Ideal D/A Conversion

Page 17: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Ideal D/A Conversionof course, it’s impossible to make an ideal D/A converter. An ideal lowpass filter can’t be realized, and we can’t create a train of ideal impulses.

Furthermore, there will always be errors due to finite word length (quantization error). There will also always be some aliasing, because no signal is perfectly bandlimited.

We can approximate an impulse train, though, and we can approximate an ideal lowpass filter. Therefore, we can make an imperfect D/A converter.

Page 18: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Ideal D/A ConversionNow let’s talk about D/A conversion from a time domain viewpoint. When we filter xs(t) to remove the spectral copies and recover xa(t), we’re convolving xs(t) with the impulse response of the ideal lowpass filter.

thtxtx asa

t

T

tT

tT

tf

t

tfTth sc

a

sinsin2sin

Page 19: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Ideal D/A ConversionThis process connects the “dots”, which are the magnitudes of the impulses that comprise xs(t). In otherwords, the ideal D/A conversion process is also an ideal interpolation process.

Convolving the xs(t) with ha(t),

dt

T

tT

x

dthxtx

s

asa

sin

Page 20: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Ideal D/A Conversion

n

as nTnTxx

But

so,

dt

T

tT

nTnTxtxn

aa

sin

Page 21: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Ideal D/A ConversionRearranging,

dt

T

tT

nTnTxtxn

aa

sin

And, using the sifting property:

tT

tT

nTxtxn

aa

sin

This is the ideal interpolation formula.

Page 22: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionThe ideal D/A converter uses the sequence x(n) to generate a weighted impulse train, xs(t). An ideal lowpass filter then “connects the dots” by smoothing the impulse train.

A real D/A converter generates a series of “rectangular” pulses, weighted according to the sequence x(n).

Page 23: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionHere’s a depiction of the impulse train generated by an ideal D/A converter for some sequence x(n):

xs(t)

t2T 3T 4TT0-T-2T-3T-4T

Page 24: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionHere’s the pulse train generated by a real D/A converter, overlayed with the impulse train.

xp(t)

t2T 3T 4TT0-T-2T-3T-4T

Page 25: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionThe pulse train is generated by weighting a series of rectangular pulses, like the one shown here:

ga(t)

tT0

A

The pulse train can be written as:

nTtgnxtx an

p

Page 26: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionNormally, the D/A converter does not include a lowpass filter (although the pulse train generation is a lowpass process of a sort). In most cases, a analog filter is required downstream.

It we compare xp(t) to xa(t) (the original continuous-time signal), xp(t) is a staircase approximation of xa(t) .

Page 27: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionIn the frequency domain,

fXfGfX sap

fXfHfX saa

for the ideal converter, where Ha(f) is the transfer function of the ideal lowpass filter, and

for the real converter, where Ha(f) is the Fourier transform of the rectangular pulse ga(t)

Page 28: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionIn the frequency domain, Xp(f) is the product of Xs(f) and Ga(f). In the time domain, xp(t) is obtained by convolving xs(t) with ga(t):

txtgnx

dtgnTnx

txdtgnTnx

dtgtxtx

pan

an

pan

asp

Page 29: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionTo see what this looks like spectrally, we need to know the spectrum of the retangular pulse, Ga(f). In chapter 3, we saw that the Fourier transform of the rectangular pulse shown below

r(t)

tT/20

A

-T/2

was given by:

f

fTAfRa

sin

Page 30: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionBy comparing this to ga(t), we see that ga(t) is ra(t) delayed by T/2. Therefore, by the time shifting theorem,

f

fTefG

Tfj

a sin2

2

and its amplitude response is:

f

fTfGa

sin

Page 31: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionIf we plot the amplitude response, it looks as shown in figure 7-8 of the textbook. Notice that, in the range of frequencies between 0 and fs/2, the frequency response is far from ideal.

If the Nyquist criterion is barely satisfied (fs = 2B), the real world D/A converter attenuates those frequencies close to B more than it should, and this is a source of error in reproducing xa(t)

Page 32: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Real-World D/A ConversionThis error can be reduced by oversampling – making fs much greater than 2B. This has the effect of broadening the main lobe of Ga(f), and reduces the difference in amplitude between 0 and B. This is illustrated in Figure 7-9.

Page 33: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

Problems

Page 34: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The FFTAny sequence, regardless of duration, has a DTFT given by

nj

n

j enxeX

If x(n) is a finite duration sequence,

otherwise ,0

1,,1,0 ,

Nnnx

it also has a DFT.

Page 35: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The FFTFor such a sequence, the DTFT may be found without using infinite summation limits:

njN

n

j enxeX

1

0

Keep in mind that, although x(n) is a discrete function, X(ej) is a continuous function of . The DFT of x(n) is a discrete function of frequency, and consists of samples of X(ej).

Page 36: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The DTFT

In other words, if we take the continuous function of X(ej) and sample it in the frequency domain at intervals of

N

2

then we get the DFT of x(n):

1,,2,1,0 ,2 , NkkeXnxDFT j

Which may be rewritten:

1,,2,1,0 ,21

0

2

NkenxeXnxDFTn

N

kjN

n

N

kj

Page 37: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The DTFT

We could denote the DFT of x(n) as X(ejk/N), but it’s usually represented by X(k) instead. Therefore, we have the following discrete Fourier transform pair:

1,,1,0

1,,1,0 ,

Nk

NnkXnx

1,,2,1,0 ,21

0

NkenxkX

nN

kjN

n

where

Page 38: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The DTFT

Some key points:

•If the sequence x(n) is N samples in length, X(k) consists of N (generally complex) samples of X(ej).

•The spacing (in frequency) between samples of the DFT is 2/N. More samples means closer spacing, and finer spectral resolution.

Page 39: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The DTFT

More key points:

•The N samples of the DFT span the frequency range from 0 to 2. NOT – to . Sample 0 (k=0) is at =0, and sample N-1 (the last sample) is at =2(N-1)/N. There is no sample at =2

•If the DFT, X(k), is plotted, it is like plotting X(ej) on the interval from =0 to =2

•The frequency variable ant the DFT index k are related by

N

k 2

Page 40: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The DTFT

More key points:

•w and the frequency in Hertz are related by

sf

f 2

•k and the frequency in Hertz are related by

kN

ff s

Page 41: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The DTFT

More key points:

•The spacing between frequency-domain samples of the DFT (also called the frequency resolution or bin width) is given by

N

ff s

•The relationship between the DTFT and the DFT is illustrated in Figure 8-2.

Page 42: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The FFT

We could compute the DFT of a sequence using the DFT definition:

1,,2,1,0 ,21

0

NkenxkX

nN

kjN

n

Inspection of this equation reveals that evaluating it requires on the order of N2 complex multiplications, a good indication of computational complexity.

Page 43: DTFT And Fourier Transform Consider a continuous-time signal x a (t), and a sequence x(n) obtained by sampling x a (t) with sampling period T: x a (t)

The DFT and The FFTThe FFT (Fast Fourier Transform) is a more computationally efficient implementation of the DFT, which only requires on the order of N log2(N) multiplications. If N=1024, this comes out to 10,240 multiplications for the FFT, and 1,048,576 for the DFT.

Nobody (almost) writes their own implementation of the FFT. It is readily available, in any programming language you like. All you really need to know is how to use it.